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
0
votes
1 answer

Wait for one animation in ImageView to stop to start anotherone?

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.genie_out); genie = (ImageView) findViewById(R.id.genieout); startService(new Intent(this,…
JRowan
  • 6,824
  • 8
  • 40
  • 59
0
votes
1 answer

Using a database in android activity

I am learning how to use a sql database in an Android activity. I am learning from this tutorial. I have an activity in which I use the database handler, from the tutorial. I make a declaration of the variable inside of activity class.…
Borut Flis
  • 15,715
  • 30
  • 92
  • 119
0
votes
1 answer

Android: onResume() not called after pressing home button

I have an activity that makes a call to a remote server when it's started. The thing is, that when the app is on the background, and the server creates new content, when restoring my app, this new content is not seen unless the app is killed and…
noloman
  • 11,411
  • 20
  • 82
  • 129
0
votes
2 answers

rails boolean value reset on create

I have a field in my model called isTransfer: class AddTxfrColumnsToTransaction < ActiveRecord::Migration def change add_column :transactions, :isTransfer, :boolean add_column :transactions, :transferAccount_id, :integer end end I…
Cagilla
  • 13
  • 4
0
votes
1 answer

shifting the onCreate() content into the application class

My app contains 25 edittexts. I am getting this 25 edittexts with the help of adapter class by giving count=25 and fitting in gridView by gridView.setAdapter(new TextAdapter(this)); in the activity class. So, the edittexts are dynamically generated.…
Spike
  • 147
  • 3
  • 17
0
votes
1 answer

Create statement is not workin in rails

So I have a relationship of project to categories, such that a project can have many categories and a category belongs to a project. I have managed to have it working, but now - when I restartded my rails server, it doesn't work. The code I show…
TheWebs
  • 12,470
  • 30
  • 107
  • 211
0
votes
1 answer

Fragments onCreate after app process been killed

I have an app which is basically a launcher with a main activity and view pager fragments and i just noticed that if i launch an app from my app and my app gets killed when i return somehow the on create fragment function get´s called first that my…
Steve
  • 427
  • 4
  • 14
0
votes
1 answer

CheckedTextView can't be toggled in the setOnItemClickListener onCreate method

I have ArrayAdapter, where I set array of files: adapter = new ArrayAdapter(this, R.layout.file_manager, R.id.checkedTextItem, fileList) { @Override public View getView(int position, View…
Rikki Tikki Tavi
  • 3,089
  • 5
  • 43
  • 81
0
votes
0 answers

Why does the app take so much memory even before onCreate() is called?

i've noticed a weird thing , and i wonder if it has always been this way: on android ICS , i've set a breakpoint on the first line of the onCreate of the first activity that is launched (even on a hello-world app) , and i've chosen via the DDMS the…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
0
votes
2 answers

NullPointerException while calling an Activity

My program is crashing when I click on a button to bring me to another page. My OnClickListener seems correct but I know I've missed something. Can anyone see where I have went wrong? error: 08-20 13:40:30.622: E/AndroidRuntime(1026):…
user1165694
  • 1,255
  • 2
  • 18
  • 29
0
votes
1 answer

Android: display a layout for some second at launching app

If the app isn't already stored in memory and it needs to execute the onCreate method ( after a kill ), I want to show a layout ( essentially an image ) for some seconds when the app is launched. Then I want to load the basic layout of the…
lory105
  • 6,112
  • 4
  • 31
  • 40
0
votes
2 answers

Android App, called a onCreate Again after 10 - 15 minutes. why?

I have an application on android with PhoneGap. when I open the app, called the OnCreate. when I leave the app, let it work in the background and after 10 to 15 minutes, turn and enter the app called OnCreate again. and change the…
0
votes
2 answers

Create method that returns value gotten at applucation start

I'm developing an application where I want to find out what volume the user had when he started my app from a method thats not onCreate(). I have created an int based on the current volume inside my onCreate but since it can't return anything I…
SweSnow
  • 17,504
  • 10
  • 36
  • 49
0
votes
1 answer

Android layout only showing after oncreate method finishes

I have created (what I thought was) a simple JAVA card game. In JAVA, the game loads the layout (frame) and displays ImageButtons consisting of a square like cardholder image for each player. The cardholders are then populated by random cards from…
SteelersFan
  • 1
  • 1
  • 4
0
votes
1 answer

Different operations onCreate in an Activity

I want to do different operations in onCreate() depending activities I come from. I do that making this: Activity A: intent to activity B; intent.putBoolean("name",boolean=false); startActivity B. Activity B: onCreate(){ …
Dors
  • 5
  • 1
  • 3