
Untitled
By: a guest on
May 25th, 2012 | syntax:
None | size: 0.54 KB | hits: 11 | expires: Never
Opening an activity in Android without having to Reload it from scratch
Intent intent = new Intent(this,SecondActivity.class);
startActivityForResult(intent, RESULT_OK);
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
// When you are back from second Activity you are land here ..
// do what ever you want to, without re Creating the this Activity
}
}
Activity.this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));