2010-11-27 4 views

Répondre

2

Vous pouvez essayer soit ceci:

MyActivity.finish() 
Intent intent = new Intent(MyActivity.this, MyActivity.class); 
startActivity(intent); 

Ou si cela ne fonctionne pas, vous pouvez le faire:

private boolean isRestarting = false; 
... 
// When button is pressed 
isRestarting = true; 
myactivity.finish(); 
... 
// in the onDestroy() method 
if(isFinishing() && isRestarting){ 
    Intent intent = new Intent(MyActivity.this, MyActivity.class); 
    startActivity(intent); 
}