Start two activities simultaneously one in foreground other in background

Home / Uncategorized / Start two activities simultaneously one in foreground other in background

I have two activities SplashScreen and MainActivity.

MainActvity download some data and show it.

Now I want to start both activities on application start, MainActivity in background and SplashScreen in foreground and when the data of MainActivity download complete I want to make MainActivity foreground and finish SplashScreen.

I have seen many solution but no one is going good in my situation. Please give me some suggestion or example .

I think it’s better to make splash screen to download data and when it completed show new activity (MainActivity). In onStart metod use downloaded data stored on phone.

Your example: The only way You can have resolve this your way is by start MainActivity first and from onStart start SplashScreen:
class SplashScreen extends Activitiy {

public void onStart() {

public void finishedDownload(FinishedDownloadEvent) {

class MainActivity extens Activity () {

public void onStart () {
open(new Intent(SplashScreen.class)); // We would like to have


public void download (OnFinish onFinish) {
… download FinishedDownloadEvent());

I forgot:
class EventBus {

private final static Bus instance = new Bus();

public static void register (Object obj) {

public static void post (Event obj) {


Read more

Leave a Reply

Your email address will not be published. Required fields are marked *