oncreate Questions

4

Solved

I am trying to create a local database on an android phone using sqlite. I have a helper class, shown below, that is used to create the database and provide the "help". I am wanting to create an...
Amann asked 17/2, 2011 at 1:38

10

Solved

I have some code in the onCreate method an Activity and noticed that it is being called three times. Is it normal behaviour? Thanks.
Fourflush asked 27/8, 2010 at 23:4

6

Solved

Where to set all Listeners for the user interfaces? Is it good practice to set them in onCreate? This looks so unstructured and strange. Is there a better place to set them?
Stefan asked 18/1, 2014 at 12:36

12

Solved

Can anyone help me to find out what can be the issue with this program. In the onCreate() method the findViewById() returns null for all ids and this causes a null pointer exception later. I can no...
Fusspot asked 29/9, 2013 at 13:16

2

Solved

I've created AbstractActivity and an AbstractFormActivity to rid of some boilerplate code, their content may be irrelevant to the question, but I will post it anyway, maybe I misunterstood somethin...
Acicular asked 25/4, 2015 at 22:1

5

I am trying get into Android programming, and for I am taken some examples from a book. In on of these example is requested to put the following code: public class ExemploCicloVida extends Activit...
Darden asked 13/11, 2011 at 3:4

9

Solved

What is the life cycle of an Android activity? Why are so many similar sounding methods (onCreate(), onStart(), onResume()) called during initialization, and so many others (onPause(), onStop(), on...
Apul asked 15/12, 2011 at 6:20

3

Solved

I found that onCreate of ContentProvider gets called first, even before the onCreate of my Activity. eg: Vogella Android SqlLite. But I wanted to know how does it happen and why? Is it because ...
Boating asked 21/3, 2012 at 4:44

3

Solved

What are the differences between onCreate(), onCreateView(), and onActivityCreated() in fragments and what would they each be used for?

3

Solved

I have classes A, B and C. Class A sends intent to B, B runs C, C returns to B.....but then inside of the onCreate of the B class it wants the intent of Class A. But because its come from class C i...
Wamble asked 10/3, 2013 at 20:16

3

Solved

Is there technically any reason why I should use onRestoreInstanceState? Could I not do all the restoration in onCreate by checking if the savedInstanceState bundle is null? What is the primary ben...
Tetanic asked 4/4, 2016 at 17:10

5

Solved

There is something I don't quite understand right now. My main activity class creates a Service, which creates a new thread that waits for a TCP connection. Once one comes in, it will start a new ...
Hornsby asked 29/11, 2010 at 0:4

5

Solved

I am new to android trying to understand what the below method does public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // load the layout setContentView(R.lay...
Marginalia asked 23/10, 2013 at 10:19

1

Solved

I released an update to an Android app yesterday, and today I am seeing a few crash logs in Crashlytics: Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex...
Sonora asked 20/5, 2019 at 18:35

7

Solved

I have few activities and from one activity I open another and that go back to the first one... The point is onCreate is called ones , and onResume every time when the activity is show. For exampl...
Perception asked 20/9, 2011 at 11:49

8

Solved

When the user hits an icon in my app, I want the app first to check if the device is connected to the internet and then do something depending on the result it receives (for know it's just popping ...
Seducer asked 25/7, 2012 at 8:45

5

Solved

I'm very new on Android development. I want to create and start an activity to show information about a game. I show that information I need a gameId. How can I pass this game ID to the activity?...
Roer asked 12/10, 2010 at 10:19

1

Solved

I've recently tried to use StrictMode but got a weird violation, so I tried setting up a new 'Empty Activity' project (in Android Studio) and added an Application class as follows (as described in ...
Firebird asked 25/6, 2018 at 10:30

6

Solved

What I want is when I load my app up it to randomly have a certain colored background from a predefined list of strings stored in a values xml file called colours. What I currently have is one co...
Strickman asked 18/9, 2014 at 22:1

5

I'm dealing with .setVisibility() of a view, inside my main fragment at app start. So what I want is that the view is invisible on app start (for this i set INVISIBLE inside onCreateView) and to be...
Airlie asked 27/1, 2016 at 14:4

3

In my app, I use a service to communicate with our server. The Service spawns several message queue threads to deal with tasks with different priorities. This model has been used for about one yea...
Winterkill asked 26/8, 2011 at 22:13

4

When I lock the screen while my app is running "on top", the system calls almost immediately onCreate (screen is still black). What could be the reason for this destructive behaviour?
Andean asked 1/5, 2013 at 14:29

6

Solved

I use a FragmentPagerAdapter to switch from fragments. I need some functions to be called when a fragmentswitch is made and had some troubles with OnPause and OnResume, so as suggested by THIS ques...

5

Solved

I can only set my Activity to Full Screen in onCreate method (before setContentView)? Is there any way I can set to full screen outside of onCreate? Thanks
Dispirit asked 26/1, 2012 at 18:8

2

Solved

I upgraded my android studio to 2.1.3. And now I am getting following error java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/vie...
Cavitation asked 19/8, 2016 at 23:47

© 2022 - 2024 — McMap. All rights reserved.