Recently in the first line of code this book, there is an example of the activity life cycle, but I myself with the Mac mounted as running a problem, see log is android.util.AndroidRuntimeException: Requestfeature () must be called before adding content this error, from the Internet to find a half-day, finally found a solution, although not too understand the principle, but here to do a share it.
This is the code after the change.
1 protected void onCreate (Bundle savedinstancestate) {2 requestwindowfeature (window.feature_no_title); 3 4 Super . OnCreate (savedinstancestate); 5 Setcontentview (r.layout.dialog_layout); 6 }
Originally requestwindowfeature This method is in the second sentence, but did not match the content of the error, but do put this statement in the front to run, there is know why the great God can help me answer, thank you.
Android.util.AndroidRuntimeException:requestFeature () must be called before adding content solution