Hi,

You can do that by using the onKeyListener.
For exemple in your onCreate :
yourView.setOnKeyListener(XYZ);

In the XYZ class :
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK &&
event.getAction()==KeyEvent.ACTION_DOWN) {
//blablabla do things
}
return true;
}


Just remember that it's not always a good idea to override this kind of
things ;)



On Thu, Jul 15, 2010 at 3:24 PM, Ajmer Singh <[email protected]> wrote:

> I am a new to android development
> I want to override the default back button operation in android,please let
> me know how i can do this in code.
>
> --
> Thanks and Regards
> Ajmer Singh
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to