I have an Android application. I am making a loading screen with a progress bar.
I entered a delay in the onCreate method. When the timer finishes, I want to finis
If you are doing a loading screen, just set the parameter to not keep it in activity stack. In your manifest.xml, where you define your activity do:
And in your code there is no need to call .finish() anymore. Just do startActivity(i);
There is also no need to keep a instance of your current activity in a separate field. You can always access it like LoadingScreen.this.doSomething() instead of private LoadingScreen loadingScreen;