私はAndroid2.2用のYfilesに取り組んでいます。ライブラリの所有者から提供されたチュートリアルをインポートしたとき。次のエラーが表示され、アプリケーションが実行されていません。誰かが次の例外を理解できるなら、私に訂正してください。
09-11 10:28:50.478: E/AndroidRuntime(11938): FATAL EXCEPTION: main
09-11 10:28:50.478: E/AndroidRuntime(11938): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yworks.android/com.yworks.android.SampleApplication}: android.view.InflateException: Binary XML file line #8: Error inflating class com.yworks.yfiles.ui.GraphControl
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1872)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.os.Handler.dispatchMessage(Handler.java:99)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.os.Looper.loop(Looper.java:150)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread.main(ActivityThread.java:4389)
09-11 10:28:50.478: E/AndroidRuntime(11938): at java.lang.reflect.Method.invokeNative(Native Method)
09-11 10:28:50.478: E/AndroidRuntime(11938): at java.lang.reflect.Method.invoke(Method.java:507)
09-11 10:28:50.478: E/AndroidRuntime(11938): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
09-11 10:28:50.478: E/AndroidRuntime(11938): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
09-11 10:28:50.478: E/AndroidRuntime(11938): at dalvik.system.NativeStart.main(Native Method)
09-11 10:28:50.478: E/AndroidRuntime(11938): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.yworks.yfiles.ui.GraphControl
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-11 10:28:50.478: E/AndroidRuntime(11938): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:250)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.Activity.setContentView(Activity.java:1742)
09-11 10:28:50.478: E/AndroidRuntime(11938): at com.yworks.android.SampleApplication.onCreate(SampleApplication.java:28)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836)
09-11 10:28:50.478: E/AndroidRuntime(11938): ... 11 more
09-11 10:28:50.478: E/AndroidRuntime(11938): Caused by: java.lang.ClassNotFoundException: com.yworks.yfiles.ui.GraphControl in loader dalvik.system.PathClassLoader[/data/app/com.yworks.android-1.apk]
09-11 10:28:50.478: E/AndroidRuntime(11938): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
09-11 10:28:50.478: E/AndroidRuntime(11938): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
09-11 10:28:50.478: E/AndroidRuntime(11938): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
09-11 10:28:50.478: E/AndroidRuntime(11938): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
09-11 10:28:50.478: E/AndroidRuntime(11938): ... 20 more
Javaファイルは次のとおりです。
package com.yworks.android;
import android.app.Activity;
import android.os.Bundle;
import com.yworks.yfiles.ui.GraphControl;
import com.yworks.yfiles.ui.model.GraphExtension;
import com.yworks.yfiles.ui.model.IGraph;
/**
* Getting Started - 01 Creating the View
*
* This demo simply introduces class {@link GraphControl}, the
* central UI element for working with graphs in @PRODUCT@,
* and {@link GraphExtension}, which provides convenience
* methods for working with IGraphs.
*/
public class SampleApplication extends Activity {
private GraphControl graphControl;
private GraphExtension graphExtension;
@Override
protected void onCreate( final Bundle savedInstanceState ) {
super.onCreate(savedInstanceState);
// Sets the content view to the main layout loaded from
// res/layout/main.xml
setContentView(R.layout.main);
// The GraphControl is declared in the loaded layout,
// so now we can retrieve a reference to it
graphControl = (GraphControl) findViewById(R.id.graphControl);
// GraphExtension provides convenience methods
// which are used in the following demos.
graphExtension = new GraphExtension(graphControl.getGraph());
// We'll initialize the app here in the following demos.
}
/**
* Convenience property for getting the GraphControl's Graph
* @return The GraphControls Graph
*/
public IGraph getGraph() {
return graphControl.getGraph();
}
}
ありがとうよろしくiambilloo