How to Disable Back Button in Android App

How to Disable Back Button in Android App


In this article, we are going to learn about Disable "Back button" in an Android application.


1. This is how our android application looks like;


2.Project Structure;


3.code

MainActivity.xml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public void onBackPressed() {

    }
}

You can download the app from here;


You can download the full source code of this tutorial here;

SHARE

Androidstuff.net

Hai. I am one of the Authors of androidstuff.net. I am Android Developer, UI/UX Designer, Web Developer, Business Enthusiast, Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment