Questions tagged [onstart]

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

117 questions
5
votes
3 answers

Where do I put the bulk of my code when writing a windows service?

I am getting into windows services and looking over some tutorials, but they are all very dumbed down. They usually involve printing something out in the overridden OnStart method. That sounds like it gets called once. Now where would I put code…
Matt Vaughan
  • 1,135
  • 2
  • 13
  • 19
5
votes
4 answers

Start animation when fragment is visible on ViewPager

I'm using a ViewPager together with a FragmentStatePagerAdapter, and I would like to launch an animation in a fragment when this fragment is visible and only when it is visible. The problem is that the animation starts when the fragment is the one…
thomaus
  • 6,170
  • 8
  • 45
  • 63
4
votes
1 answer

Flutter : No top-level getter 'onStart' declared

I modified the sample code given in the flutter_background_service: ^2.4.5 package to get BuildContext. From then, I get this error saying [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: NoSuchMethodError: No top-level getter…
Kate Jo
  • 154
  • 1
  • 10
4
votes
2 answers

Signalling Initialization Failure from Service.OnStart

We have a case where during Service startup (OnStart), a worker thread is started. The worker thread connects to a SQL database. If the database is unavailable, the worker thread can signal the main thread of the failure. The question is; How to…
RegexCoder
  • 71
  • 6
4
votes
1 answer

Android - is onStart() called immediately after onCreate()?

If I have two activities A and B. And I create an intent that initiates activity B from the onCreate() of activity A, when will the onStart() of activity A be called? For example, let us say I had the following: public void onCreate(Bundle…
John Doe
  • 397
  • 3
  • 18
4
votes
2 answers

GlobalSettings onStart fires only after first request

I need to run some code only once when I starts the play server. When using the GlobalSettings.OnStart() I notice that the code is executed only after the first (http) request to the server. Any idea how can I run my code just after the server…
4
votes
1 answer

ListView doesn't visually update its content after notifyDataSetChanged

I have a static array of items which is set to a listview, that I might modify from another Activity (add some more items to it). So when I turn back to first activity, I have to refresh the content of the listview with the new items. I do that by:…
DoruAdryan
  • 1,314
  • 3
  • 20
  • 35
3
votes
3 answers

Wait/Sleep inside Azure WebRole OnStart method

Is it a good practice to Wait/Sleep inside the RoleEntryPoint.OnStart method of a webrole? We want to make sure our service is fully ready before we tell Azure that we are ready to service request.
Prapti
  • 65
  • 1
  • 5
3
votes
1 answer

Getting settings from appsettings.json to afterStarted(options) in Blazor | Blazor Server

i want to set variable (someFlag = false/true) in JS so i can disable/enable javascript function. I would like to do it with afterStarted(options) [described in link…
3
votes
1 answer

onCreate launches twice without any UI changes

I am currently developing an app with network requests. However, even though I requested once, there were two results that arrived. (Checked with logcat) After that, I began to study about Android Lifecycles, and I added logs to ALL of the Lifecycle…
3
votes
1 answer

Setting MainPage = NavigationPage during OnStart in Xamarin.Forms displays a blank screen in Android

I have a Xamarin Forms Application where I'm setting the MainPage to NavigationPage during OnStart. The NavigationPage is static (kept in memory for reuse). When I press the back button in Android and go back to the app the OnStart method is…
Oscar Fraxedas
  • 4,467
  • 3
  • 27
  • 32
2
votes
1 answer

Should onStart still run if you stop a service during onCreate?

From my understanding of application lifecycle (including services) it should go onCreate > onStart > onResume. Based on this understanding, if you shut down the cycle with a this.stopSelf() in the onCreate it should never fire the onStart. …
Ashterothi
  • 3,282
  • 1
  • 21
  • 35
2
votes
1 answer

How to set global variable with Power Apps OnStart property

I have created blank canvas app and I want to create product details like product name, price, category,quantity, color, etc..., by using set function with OnStart property. Please, suggest any information about this. I want to create global…
2
votes
1 answer

How to check for a phone auth user in Android?

How to modify this onStart() method to get my separate Phone auth user database? @Override protected void onStart() { super.onStart(); FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null) { …
2
votes
3 answers

why does onStart() method run before onCreate in my android project?

According to the activity lifecycle, onCreate() is called once when the app is created, followed by the onStart() method which may be called multiple times throughout the activity lifecycle. Yet that's not whats happening to me. I have this code…
Vladimir Rosca
  • 377
  • 1
  • 2
  • 15