i have 3 activitys FirstActivity,SecondActivity,ThridActivity respectively, i put "intent" FirstActivity to SecondActivity , SecondActivity to ThridActivity.
Now if i click the backButton {onBackPressed()} on ThridActivity i want to go to the FirstActivity.
but i don't need 'Intent' to FirstActivity in 'onBackPressed()', i need two backpress code.
public void onBackPressed() {
finish();
}
public void onBackPressed() {
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));
}
these codes are working only single backpress.