Android: How to make launcher always open the main activity instead of child activity? (or otherwise

Posted by yuku on Stack Overflow See other posts from Stack Overflow or by yuku
Published on 2010-05-26T03:10:28Z Indexed on 2010/05/26 8:11 UTC
Read the original article Hit count: 230

Filed under:
|
|
|
|

I have activities A and B. The A is the one with LAUNCHER intent-filter (i.e. the activity that is started when we click the app icon on home screen).

A launches B using startActivity(new Intent(A.this, B.class)).

When the user has the B activity open, and then put my application into the background, and later my application's process is killed, when the user starts my application again, B is opened instead of A.

This caused a force close in my app, because A is the activity that initializes the resources my app needs, and when B tried to access the uninitialized resources, B crashes.

Do you have any suggestions what should I do in this situation?

© Stack Overflow or respective owner

Related posts about android

Related posts about application