i have created two activity.xml,that is first.xml and second.xml and when user navigate to second.xml layout and when they pressed back button i want to totally kill the app that is when they again open it after back pressed they firstly see first.xml....but this doesnt happen.... THIS IS MY secondactivity.java
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
public void onBackPressed() {
moveTaskToBack(true);
}
}