Questions tagged [onstart]

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

117 questions
165
votes
2 answers

Difference between onCreate() and onStart()?

Possible Duplicate: Android Activity Life Cycle - difference between onPause() and OnStop() I was wondering - what is the difference between onCreate() and onStart() methods? I think that onStart() is a redundant method. onCreate() will ALWAYS be…
iTurki
  • 16,292
  • 20
  • 87
  • 132
29
votes
2 answers

In Android, How can I avoid the onStart method from being deprecated?

I am having a problem with setting the onStart method in my app. It always has a strikethrough, saying "This method was deprecated in API level 5. I need onStart, not onStartCommand. How can I resolve this? MyNotificationService.java import…
Christopher Treanor
  • 505
  • 2
  • 8
  • 13
23
votes
4 answers

Resume activity in Android

I have an app with 3 activities. I have the main activity. This calls the second activity, which then calls the third activity. I want return to the main activity without entering the onCreate. This is the code for the third activity:…
Sárzena
  • 241
  • 1
  • 2
  • 4
12
votes
7 answers

ActionBar pre Honeycomb

I am writing an app for android (2.1 > 3.1) and I would like to use the familiar practice of using the app Icon in Honeycomb apps to go up to the home activity, however, when I run the activity on earlier, non Honeycomb devices where the…
rabbitt
  • 2,558
  • 8
  • 28
  • 41
10
votes
3 answers

Launch an animation onstart CustomViewPager

I succeed to create an animation at the start of my CustomViewPager which act like a Carousel. So here, my items came from the left and goes to the right in 3 seconds. The thing is it's just a translation I was wondering if it's possible to just…
zed13
  • 357
  • 4
  • 21
10
votes
3 answers

What's the difference between the webrole onStart() event and Application_Start() global.asax event?

I'm just starting to get my feet wet learning the technical details of Azure, so apologies if this is a silly question. If I create a cloud service project in visual studio and add a webrole for an mvc application, within the mvc application I can…
Steviebob
  • 1,705
  • 2
  • 23
  • 36
10
votes
2 answers

NetworkOnMainThreadException error in jellybean

I've been trying to get this to work for the last week or so and still have no idea what the problem is. it works on android 2.1 but not on 4.1. ive got this string in a service that check for updates in my app. latestVersion =…
9
votes
4 answers

android.os.NetworkOnMainThreadException on service start on android

after trying my brand new service on android i get this: i guess is something related to the manifest file and permissions, the service is started after the last activity, to update data on server and retrieve new data and save id on sqlite on…
7
votes
2 answers

Android lifecycle: Fill in data in activity in onStart() or onResume()?

Should you get data via a cursor and fill in the data on the screen, such as setting the window title, in onStart() or onResume()? onStart() would seem the logical place because after onStart() the Activity can already be displayed, albeit in the…
pjv
  • 10,658
  • 6
  • 43
  • 60
7
votes
2 answers

Android - Activity onCreate and Fragment onCreate

I'm still new to Android programming, so this question is rather basic. I see lots of code samples on the Internet where UI components, like a TextView, are being initialised and accessed in the onCreate() method of an Activity. When I use Android…
Hippogriff
  • 295
  • 1
  • 4
  • 18
7
votes
2 answers

C# Converting Console App to Service

I am trying to convert a console app to a Windows service. I am trying to have the onstart method of the service call a method in my class but I can;t seem to get it to work. I'm not sure I am doing this correctly. Where do I put the class…
user2892443
  • 103
  • 1
  • 2
  • 5
7
votes
3 answers

How to run a task when a windows service starts?

I have a windows service and I've written the code to run the task within the OnStart() event: protected override void OnStart(string[] args) { this.DoTask(); } private void DoTask() { Task task1 =…
The Light
  • 26,341
  • 62
  • 176
  • 258
6
votes
3 answers

When activity will be visible? After onStart() or onResume()?

Docs say: The visible lifetime of an activity happens between a call to onStart() until a corresponding call to onStop(). Also in this one you can see: The onStart() call makes the activity visible to the user ... So I thought the UI of Activity…
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167
5
votes
3 answers

What comes between onCreate and onStart for Android?

I see from Android Developers (http://developer.android.com/reference/android/app/Activity.html) that there is a nice flowchart showing onCreate leading to onStart then to onResume, and so forth. My question is: what other on****() methods appear…
5
votes
1 answer

Run Android App Twice To Work, Why?

I'm making an android app that test if certain security features on your phone are enabled. For example, if you have password log in enabled or if your data is encrypted on your phone. For some reason, the app has to be ran twice to test and see if…
pHorseSpec
  • 1,246
  • 5
  • 19
  • 48
1
2 3 4 5 6 7 8