Android refresh current activity [duplicate]
Solution 1:
public void onClick (View v){
Intent intent = getIntent();
finish();
startActivity(intent);
}
Solution 2:
You may try this
finish();
startActivity(getIntent());
This question was asked before: How do I restart an Android Activity
Solution 3:
In an activity you can call recreate()
to "recreate" the activity
(API 11+)
Solution 4:
This is a refresh button method, but it works well in my application. in finish() you kill the instances
public void refresh(View view){ //refresh is onClick name given to the button
onRestart();
}
@Override
protected void onRestart() {
// TODO Auto-generated method stub
super.onRestart();
Intent i = new Intent(lala.this, lala.class); //your class
startActivity(i);
finish();
}