android - How to change ParentActivity programatically? -


we can set parent activity this

 <activity         android:name=".ui.launch.signupactivity"         android:label="@string/title_activity_sign_up"         android:parentactivityname=".ui.launch.loginactivity" >         <meta-data             android:name="android.support.parent_action"             android:value=".ui.launch.loginactivity" /> 

but how can change parent activity programatically?

i'd suggest don't specify parent activity @ in case. instead override onbackpressed() event in activity , lunch new activity yourself:

@override public void onbackpressed(){     finish();     if(condition){         launchactivity1();     }else{         launchactivity2();     } } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -