I tried to use one android project to another android project for this purpose I use
Properties--->Build Path-->Project--->Add(Select the project then add it) -->Order and Export--> select project
But this gives the following error:
07-26 11:03:09.878: E/AndroidRuntime(573): FATAL EXCEPTION: main
07-26 11:03:09.878: E/AndroidRuntime(573): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.gps_test_prt/com.example.gps_test_prt.GPS_prt_main}: java.lang.ClassNotFoundException: com.example.gps_test_prt.GPS_prt_main
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread.access$600(ActivityThread.java:122)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.os.Looper.loop(Looper.java:137)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread.main(ActivityThread.java:4340)
07-26 11:03:09.878: E/AndroidRuntime(573): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 11:03:09.878: E/AndroidRuntime(573): at java.lang.reflect.Method.invoke(Method.java:511)
07-26 11:03:09.878: E/AndroidRuntime(573): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-26 11:03:09.878: E/AndroidRuntime(573): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-26 11:03:09.878: E/AndroidRuntime(573): at dalvik.system.NativeStart.main(Native Method)
07-26 11:03:09.878: E/AndroidRuntime(573): Caused by: java.lang.ClassNotFoundException: com.example.gps_test_prt.GPS_prt_main
07-26 11:03:09.878: E/AndroidRuntime(573): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-26 11:03:09.878: E/AndroidRuntime(573): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-26 11:03:09.878: E/AndroidRuntime(573): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
07-26 11:03:09.878: E/AndroidRuntime(573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
07-26 11:03:09.878: E/AndroidRuntime(573): ... 11 more
`
Please help.
Thanks
It seems you class cannot be instantiated. This may be :
在Properties ---> Android-> Add中选择库项目,如果您使用的是ADT 22,请在Order&Export选项卡中检查Android Dependencies和Android Private Libraries。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.