指针应用程序扩展应用程序。
private pointerApplication getPoa() {
pointerApplication poa = (pointerApplication) getApplication();
return poa;
}
和错误:
06-23 11:21:30.276: E/AndroidRuntime(1374): FATAL EXCEPTION: main
06-23 11:21:30.276: E/AndroidRuntime(1374): java.lang.ClassCastException: android.app.Application cannot be cast to com.startup.tryingpointers.pointerApplication
06-23 11:21:30.276: E/AndroidRuntime(1374): at com.startup.tryingpointers.AddsubjectList.addSubject(AddsubjectList.java:49)
06-23 11:21:30.276: E/AndroidRuntime(1374): at com.startup.tryingpointers.AddsubjectList$1.onClick(AddsubjectList.java:33)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.view.View.performClick(View.java:4204)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.view.View$PerformClick.run(View.java:17355)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.os.Handler.handleCallback(Handler.java:725)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.os.Handler.dispatchMessage(Handler.java:92)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.os.Looper.loop(Looper.java:137)
06-23 11:21:30.276: E/AndroidRuntime(1374): at android.app.ActivityThread.main(ActivityThread.java:5041)
06-23 11:21:30.276: E/AndroidRuntime(1374): at java.lang.reflect.Method.invokeNative(Native Method)
06-23 11:21:30.276: E/AndroidRuntime(1374): at java.lang.reflect.Method.invoke(Method.java:511)
06-23 11:21:30.276: E/AndroidRuntime(1374): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-23 11:21:30.276: E/AndroidRuntime(1374): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-23 11:21:30.276: E/AndroidRuntime(1374): at dalvik.system.NativeStart.main(Native Method)