I\'ve two activities, one is the
SplashActivity
and the other is MainActivity
, an activity containing a webview.
I need to load the webvi
You could launch the MainActivity
first and start the SplashActivity
in onCreate()
of MainActivity
. After the required duration, you could just close the SplashActivity
and MainActivity
would reappear so that it would appear as if you have started Main from Splash.
Let me explain it -
In your MainActiviy
use an intent
and start SplashActivity
by using startActivity
and not startActivityForResult
as you would not want to pass back the result from SplashActivity
to MainActivity
.
Now that you are in SplashActivity
, start a thread and wait in the thread for the required duration and then call finish()
so that SplashActivity
will close and the previously started MainActivity
comes to the foreground.
Hope this helps.