0

i have tabactivity with 3 child activity, but i get issue back press not work to close Tab activity...

i set in Tab activity with

 @Override
      public void onBackPressed() {
        super.onBackPressed();
      }

and i set in each child activity with

@Override
      public void onBackPressed() {
        this.getParent().onBackPressed();   
      }

its seem not work, ho to fix it ? sorry for my english.. thanks

Amay Diam
  • 2,561
  • 7
  • 33
  • 57

1 Answers1

0

Try to add calling for finish() method inside your onBackPressed() method ex:

@Override
public void onBackPressed() {
  this.getParent().onBackPressed();  
  this.finish(); 
}



@Override
public void onBackPressed() {
  super.onBackPressed();
  this.finish(); 
}
Mina Tadros
  • 514
  • 6
  • 18
  • thanks for your answer, i just found, this code worked in my device but not work in other device like lenovo... – Amay Diam Feb 16 '14 at 10:17