i update variable when user decides exit app when particular spinner displayed.
i tried doing overriding onbackpressed, not called when user exits spinner via key though spinner killed.
this not work:
imageshareopts.setonkeylistener(new onkeylistener(){ public boolean onkey(view v, int keycode, keyevent event) { if (keycode == keyevent.keycode_back) { log.i("test12", "back key listener in spinner"); spinnernotdefault = false; imageshareopts.setselection(-1); } return false; } });
i have tried overide onkeydown() no called:
@override public boolean onkeydown(int keycode, keyevent event) { // todo auto-generated method stub if (keycode == keyevent.keycode_back) { // here implements code. spinnernotdefault = false; log.i("test12", "onkeydown spinnernotdefault:"+spinnernotdefault); log.d(tag, "keycode_back"); } return super.onkeydown(keycode, event); }
thanks..
Comments
Post a Comment