Android ListView for beginners - how to code a list
When programming an Android app with Java Android, you can create a so-called ListView. This is a list of values that can be scrolled up and down. The data in this list either comes from a server or is stored directly in the app.
How to create an Android ListView?
The Android Developer documentation explains exactly how to insert the ListView element. However, you should already have basic app development experience to fully understand this documentation. However, you can create a ListView without any prior knowledge, for this you use the Android Studio.- Download Android Studio and install the program on your computer.
- Open Android Studio and create an app by entering your Company Domain and otherwise leave everything at "Default".
- Select an Empty Activity and then the default. Now you can launch the app directly. To do this, click on the green play button and select "Create New Virtual Device".
- In the activity_main.xml replace the entire middle code after <tools:context="."> with <ListView android:id="@+id/list_view" android:layout_width="match_parent" android:layout_height="match_parent" />.
- Nun müssen Sie in der MainActivity.java Ihre Listview noch füllen, indem Sie MainActivity von ListActivity erben lassen und dann in die onCreate() Methode