Question

Je voudrais reprendre toute activité dans mon application à un par défaut.

Est-il possible ou non?

Était-ce utile?

La solution

Vous voulez dire la reprendre après la maison est pressé? Si oui que

@Override
protected void onRestart() {
    // TODO Auto-generated method stub
    super.onRestart();
    startActivity(new Intent(Activity1.this,DefaultActivity.class));
}

Autres conseils

La solution peut être:
1. Vous pouvez remplacer onResume méthode d'activité et peut commencer l'activité de désir avec trace de la pile claire après avoir terminé l'activité en cours.

yes . possible . keep delault activity alone into history stack .

this you can achieve by setting noHistory=true (in AndroidManifest) for all the activities except the default one . alternatively you can set same thing by java code using appropriate flag along with intent of startActivity . Now on back press , app will navigate to default screen always .

in case this default screen is not the first one approach might be :

you can create a method which will navigate user to that screen and call it in onBackPress() of all activities .

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top