This tutorial is about exiting the application after double back press. The users tend to press the back button offen. To avoid application close when the user presses the back button accidently, we can expect the user to press the back button twice. See the following steps: Override onBackPressed method. Set a static long constant.
In this tutorial we are going to show how to detect the availability of internet connection. You have to check the internet connectivity before making any HTTP calls. See flowing Steps : Add the below permissions to the AndroidManifest.xml file. <uses-permission android:name=”android.permission.INTERNET” /> for Internet access. <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> to access the network state information. […]
Progress bars are used to show progress of a task. For example. When you are uploading or downloading something from the internet, it is better to show the progress of download/upload to the user. See the following : Use ProgressDialog to create progress bar You can set the button in AlertDialog with certain function.
Let’s learn how to create Customized AlertDialog with EditText See following steps : Create a custom alert dialog layout with EditText (XML file). Inflate the custom layout to AlertDialog.Builder. Attach the AlertDialog.Builder to AlertDialog. Show the custom dialog Display the user input in main activity
Let’s start with customizing the default AlertDialog. See the post Default Alert Dialog to learn how to use default alert dialog. See flowing Steps : Create a custom alert dialog layout with EditText (XML file). Inflate the custom layout to AlertDialog.Builder. Attach the AlertDialog.Builder to AlertDialog. Show the custom dialog