Dear Karthik,
I would like to recommend you to use the following code snippet in your
activity.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
super.onKeyDown(keyCode, event);
if (keyCode == KeyEvent.KEYCODE_BACK &&
event.getRepeatCount() >= 0) {
* //it is for long press *
return false;
}
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()
== 0) {
* //It is for one time press*
return true;
}
return super.onKeyDown(keyCode, event);
}
Regards
Prashant Lal
On 24-11-2011 15:44, karthik wrote:
Sir/madam,
i am working on an application in which if i click(normal click) on
the back button the moveTaskToBackgroud(true) must be called. else if
it is a longpress then there id nothing to do.
please help
regards,
karthik
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en