Android: can we disable the default "Back" button in android?

You must Login before you can answer or comment on any questions.

Hi All! I am using light weight windows in my project, back button event listener not worked -> winDetail.addEventListener('android:back', function(e)){}. I have posted My Question on this blog too, but got no answer. Now I want to disable the back button click. is there any way to disable the default back button?

thanks in advance.

2 Answers

Accepted Answer

//handling back button
win.addEventListener('android:back',function(){
//leave it blank
});

— answered 8 months ago by kim huat
answer permalink
7 Comments
  • sorry kim! you have not read above question. I am asking "can we disable this back button click?".

    I have used above but it's not working for me as I have used the lightweight windows in my project.

    — commented 8 months ago by Abdus Sattar

  • have you try "modal:true" ?

    — commented 8 months ago by kim huat

  • no, I haven't tried "modal:true". please elaborate it if you know.

    — commented 8 months ago by Abdus Sattar

  • Show 4 more comments

var emptyview = Ti.UI.createView();
win.setLeftNavButton(emptyview);
Try this

Your Answer

Think you can help? Login to answer this question!