<?xml version="1.0" encoding="u -8"?
>
<LinearLayout
xmlns:android="h p://schemas.android.com/apk/res/android"
xmlns:app="h p://schemas.android.com/apk/res-auto"
xmlns:tools="h p://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainAc vity">
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
package com.example.app; // Example package name
import android.os.Bundl
import android.widget.ArrayAdapter;
import android.widget.ListView;
import androidx.appcompat.app.AppCompatAc vity;
public class MainAc vity extends AppCompatAc vity {
ListView l;
String tutorials[] = {
"Algorithms", "Data Structures",
"Languages", "Interview Corner",
"GATE", "ISRO CS",
"UGC NET CS", "CS Subjects",
"Web Technologies" };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac vity_main);
l = findViewById(R.id.list);
ArrayAdapter<String> arr;
arr = new ArrayAdapter<String>(
this,
R.layout.support_simple_spinner_dropdown_item,
tutorials);
l.setAdapter(arr);
}
}