Hierarchy of launching activities in android -


i have confusion how android starts launcher activities.

  1. if declaring launcher activity in manifest file this

    <activity android:name=".activities.home">    <intent-filter>        <action android:name="android.intent.action.main" />        <category android:name="android.intent.category.launcher" />    </intent-filter> </activity> 

and have application class calls activity based on check like

if(parseuser.getcurrentuser() == null){             intent intent = new intent(context,home.class);             intent.addflags(intent.flag_activity_new_task);             startactivity(intent);         }else{             intent intent = new intent(context,mainactivity.class);             intent.addflags(intent.flag_activity_new_task);             startactivity(intent);         } 

which 1 has precedence ? manifest or application. flow of events ? e.g. application->manifest (or) manifest->application (or) application overrides manifest ?

  1. if receiving notification in android, application class called. makes activities in application class started, shown above. there way detect calls application class ? i mean whether user starts it, or starts notification comes in ?

  2. if there way figure out. how prevent activity in application class called when receive notification ?

thanks in advance.

just pass boolean extras application , make diffrence in call application class , user launch.

       intent intent = new intent(context,home.class);        intent.addflags(intent.flag_activity_new_task);        intent.putextra("app_call",true);        startactivity(intent); 

now in home activity check app_call if called application class bool value true else false.

also can write in splash activity checking login .


Comments