In my app I have two fragment in ManiActivity.class . In my fragment I have a listview , when I click a item in list I open MainActivity2.class . In MainActivity2.class I have listview related and when i click list related I open MainActivity2.class with new value. Now I want create a button back home in MainActivity2.class and when I open many MainAcitivty2.class when click list related on it I can click button back home to go to MainActivity2.class I try it with
Intent intent = new Intent(MainActivity2.this,MainActivity.class)
startIntent(intent)
But when I click back button in MainActivity.class it comback MainActivity2.class , it not exit app. How I do to clear it? Please help me.