Top "Oncreate" questions

onCreate refers to one of the lifecycle methods for several components on the Android platform.

When does Application's onCreate() method get called?

In my Android application, I have a DefaultApplication class which extends android.app.Application, and in its onCreate() I bind …

android-activity oncreate application-lifecycle android
Null pointer Exception - findViewById()

Can anyone help me to find out what can be the issue with this program. In the onCreate() method the …

android nullpointerexception oncreate findviewbyid
Android - Activity Constructor vs onCreate

I understand that Android Activities have specific lifecycles and that onCreate should be overridden and used for initialization, but what …

java android garbage-collection android-activity oncreate
"System services not available to Activities before onCreate()" Error message?

When the user hits an icon in my app, I want the app first to check if the device is …

android methods oncreate
Error: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

I got a problem with my android app. I got a button and and event associated , but when I click …

java android button html oncreate
SQLiteOpenHelper failing to call onCreate?

I am trying to create a local database on an android phone using sqlite. I have a helper class, shown …

java android sqlite oncreate
Access Fragment View from Activity's onCreate

I am in the process of making my first app for Android, and I have a Fragment that gets added …

android fragment oncreate findviewbyid
onCreate flow continues after finish()

I would like to finish an activity from inside the onCreate method. When I call finish(), onDestroy() is not immediately …

android oncreate
Saving Activity State in the onPause

I have a variable that I have successfully saved and restored using onSaveInstanceState @Override protected void onSaveInstanceState(Bundle outState) { super.…

android save double lifecycle oncreate
java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener

I upgraded my android studio to 2.1.3. And now I am getting following error java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(…

android oncreate appcompatactivity