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
Post a Comment