0

I have a weird problem with exporting apk. When I run the project on eclipse, it is working correctly. But if I export the apk and install the same phone after deleting old one, it is not the same application.  The funny part is that when the installing apk is finished I have two options Open and Done when I press Open I can replicate the issue described earlier but when I choose Done and it works ok. The changes are about back button. My code part is as follows :

@Override
public void onBackPressed() {
moveTaskToBack(true);
}

This code is not work correctly if i don't run the project on eclipse.  

UPDATE :

The problem is fixed. I tried this solution and it works for me.

Android Activity Stack is not working as stated in the docs - last activity in task stack not shown

Thanks for your help.

Community
  • 1
  • 1
Selin
  • 616
  • 2
  • 9
  • 23
  • you should not create a new question, instead try to update it. Once it is updated it is already bumped. – guness Mar 28 '13 at 08:17

2 Answers2

1

Try this instead

 @Override
        public boolean onKeyDown(int keyCode, KeyEvent event) {
        super.onKeyDown(keyCode, event);
            switch(keyCode)
            {

            case KeyEvent.KEYCODE_BACK:

                return true;
            }

            return false;
        }
Devu Soman
  • 2,246
  • 13
  • 36
  • 57
0

clean project and rebuild it and use that newly created apk,i think it would make your apk works well.this also happens to me and i fix it in this way

ravi
  • 64
  • 10