问题
Is this A correct way to manually refresh an activity?
....
case R.id.action_refresh:
Intent i = new Intent(Homepage.this, Homepage.class);
Toast.makeText(Homepage.this, "refreshing", Toast.LENGTH_LONG).show();
finish();
startActivity(i);
seeing that this method destroys the activity and recreates it, i was wandering weither it may be to much of a costly method.
回答1:
The method given by you is a standard one. But if you need another method you can use the following method
onCreate(null)
来源:https://stackoverflow.com/questions/21736610/refreshing-an-android-app-activity