Questions tagged [oncreate]

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

The onCreate method is a lifecycle method of several Android components like Activities, Fragments, Services etc.

For activities and fragments, this is the first lifecycle method to be called when that component is first created. It can also provide a Bundle containing the component's previously frozen state, if there was one. This method is generally used to setup the component (for example in an Activity this would translate to creating the UI views, binding data to widgets etc).

More information can be found in:

995 questions
-1
votes
2 answers

Neo4J RelationShips MERGE ONCREATE ONMATCH

Is there a solution to distinct ON CREATE and ON MATCH on relationship MERGE ? For example : USING PERIODIC COMMIT 10000 LOAD CSV WITH HEADERS FROM 'http://ip/myfile.csv' AS row MATCH (source:Ticket {Id: toInt(row.idticket)}) MATCH (target:User…
Amos
  • 45
  • 7
-1
votes
2 answers

OnCreate expected semicolon in Android studio

public class MainActivity extends AppCompatActivity { private TaskDBHelper helper; private ListAdapter listAdapter; @Override public void onCreate(Bundle savedInstanceState) { private void…
Synetrix
  • 37
  • 4
-1
votes
1 answer

reset action passed via notification once used in onCreate

I am able to set an action when a notification is created. Once user clicks on it, application is getting opened and I was able to check the action value. I referred below link Android opening specific tab fragment on notification click Using…
-1
votes
2 answers

Change the screen orientation of screen when setRequestedOrientation called in onCreate

I am trying to develop an android application which requires me to open app a certain activity first in landscape mode however user must have that facility that they can change the orientation when they rotate the screen. Issue is I can change to…
Saty
  • 2,563
  • 3
  • 37
  • 88
-1
votes
1 answer

layout doesn't load until end of method

I'm having an issue with an acitivity for an android app, to make it simple I let there be three activities : the main M, the one that answers A and the one I start C. So M starts A using startActivityOnResult, then A sends result to M and from…
Dominus
  • 808
  • 11
  • 25
-1
votes
2 answers

Code in OnCreate isn't being run in order

I am not writing my whole code, I have the following simple structure: public class CreateEventActivity extends ActionBarActivity{ int x; void onCreate(){ new AsyncTask1().execute();//here I change the value of x …
Mark Khateeb
  • 907
  • 3
  • 11
  • 26
-1
votes
2 answers

onCreate() call when configuration changes in different API levels

I have a question about onCreate() call and orientation changes in Android. According my readings android should always recreate activity when orientation of device is changed (if you do not declare other behavior in manifes, or some other way).…
msmetak
  • 43
  • 6
-1
votes
1 answer

onCreate2(android.os.Bundle) is never used?

I am trying to make multiple buttons which open different URLs and I keep getting the same error stating onCreate2(android.os.Bundle) is never used. Does anyone know how to solve the error and what I can do to stop it occurring in the…
Dalton
  • 19
  • 1
  • 7
-1
votes
2 answers

Out of memory onCreateView android fragment communication

trying to learn som android here and need to work out fragment to fragment communication. It goes bananas on me, and crashes because of what seems to be a recursive call. And it seems to happen in FragmentA.onCreateView. Please help.. I got no…
beowwwulf
  • 259
  • 1
  • 2
  • 7
-1
votes
4 answers

Activity calls onCreate on Back

I have an Activity called A and some event on Activity A calls Activity B. Now when I use the up-navigation in the Activity B, it comes back to Activity A but also calls the onCreate method. If I use the hardware/soft keys for the back, it does not…
Samarth Agarwal
  • 2,044
  • 8
  • 39
  • 79
-1
votes
1 answer

calling a method from the onCreate

I am wanting to call a method from onCreate, but I keep getting an error in my logCat. I was looking through some of the other answers and none of them answer my question specifically. I am very new to android so i dont know much HERE IS THE…
app_maker
  • 29
  • 8
-1
votes
1 answer

The method onStart(Context, int) is undefined for the type Object

Here is the program code. Please help me. public void onStart(Context paramIntent, int paramInt) { //super.onStart(paramIntent,paramInt);//ERROR IN THIS LINE this.dbhelper = new DBHelper(getApplicationContext()); …
-1
votes
1 answer

Nullpointerexception when using 'this' pointer in OnCreate

I'm new to android and I can usually find an issue already answered. But every time I the 'this' pointer in an activity's OnCreate method it crashes with Nullpointerexception. I can move the code to OnStart and everything will run fine, but I've…
-1
votes
1 answer

extends BaseGameActivity { causes error: super.onCreate(savedInstanceState); UGH

Ok guys, I would first like to thank everyone in the past. Putting up with my poor punctuation, duplicate posts and questions I could've answered on my own. This one is a toughy, Okay, so for the last 2 days I had this issue.. Unable to execute…
-1
votes
1 answer

Problems continued to change. Android

I have a timer in my code. When the screen orientation is changed or when I leave the app with the back button, the timer does not retain the value. Is solved with onPause, onStop, onCreate methods .... but do not know exactly how. What solution…