Replace current activity

Yes. It is fine to use api this way.


The proper way to achieve this is using the following:

Intent intent = new Intent(this,MyActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
startActivity(intent);
this.finish();

The code assumes you are in an activity, otherwise if you are using fragments use getActivity()

This way, the activity is started, you properly set your hierarchy for your back button, and you also destroy the appropriate activity.