During research I found this code.
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)
{
this.moveTaskToBack(true);
return true;
}
return super.onKeyDown(keyCode, event);
}
Calling Activity like this
Intent i = new Intent(this, ActivityTwo.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.putExtra("IN_ROOMID", roomId);
i.putExtra("IN_USERID", from);
startActivity(i);
But above code minimize entire application that I don't want actually.
What is my requirement?
Suppose I have two activities say ActivityOne.java and ActivityTwo.java.
ActivityOne -> calls -> ActivityTwo
If I press back button in ActivityTwo it should be minimize and ActivityOne should resume.
Hos to achieve this. Thanks. Biraj Zalavadia.