We already discussed about using ListView in the previous tutorial Android ListView. In this tutorial, let’s learn how to customize list items in ListView to display list of items in a vertical scrollable list. See flowing Steps : Add ListView in activity_main.xml Declare your list of data in ArrayList Create a Custom Adapter class which extends BaseAdapter. Override getView() method and inflate the […]
In this tutorial, let’s learn how to use Android ListView to display list of items in a vertical scrollable list. See flowing Steps : Add ListView in activity_main.xml Declare your list of data in a String Array or ArrayList Set the data list to ArrayAdapter. Set the ArrayAdapter to the ListView.
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.