ERROR/AndroidRuntime(680): android.app.SuperNotCalledException: Activity

 
07-25 14:26:11.293: ERROR/AndroidRuntime(680): FATAL EXCEPTION: main
07-25 14:26:11.293: ERROR/AndroidRuntime(680): android.app.SuperNotCalledException: Activity {com.paul.android.recyle/com.paul.android.recyle.Build} did not call through to super.onStart()
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.Activity.performStart(Activity.java:3793)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1595)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.os.Looper.loop(Looper.java:123)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at android.app.ActivityThread.main(ActivityThread.java:3647)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at java.lang.reflect.Method.invokeNative(Native Method)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at java.lang.reflect.Method.invoke(Method.java:507)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-25 14:26:11.293: ERROR/AndroidRuntime(680):     at dalvik.system.NativeStart.main(Native Method)


 

 

怪怪的,難道重父類的方法還要調用父類的被重寫的方法?

 

不報錯

protected void onRestart() {
		super.onRestart();
		System.out.println("Build"+"====>"+"onRestart");
	}


報錯

protected void onRestart() {
	System.out.println("Build"+"====>"+"onRestart");
	}


 然後看了下Android 的文檔

The entire lifecycle of an activity is defined by the following Activity methods. All of these are hooks that you can override to do appropriate work when the activity changes state. All activities will implement onCreate(Bundle) to do their initial setup; many will also implement onPause() to commit changes to data and otherwise prepare to stop interacting with the user. You should always call up to your superclass when implementing these methods.

 

明瞭...
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章