LAB 9 Array Adapter
LAB 9 Array Adapter
Roll No:1266
Experiment:-9
Array Adapter
<TextView
android:id="@+id/head"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start Typing to Get Suggestion"
android:layout_gravity="center"
android:layout_marginTop="45dp"
android:textSize="25dp"
android:layout_centerHorizontal="true"
android:textColor="#F44336"
android:textStyle="bold"
></TextView>
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:layout_below="@id/head"
android:id="@+id/Autotxt1"/>
</RelativeLayout>
MainActivity.java
Name:-Aman Verma MET – Institute of Computer Science
Roll No:1266
package com.example.arrayadapter;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
Name:-Aman Verma MET – Institute of Computer Science
Roll No:1266
android:supportsRtl="true"
android:theme="@style/Theme.ArrayAdapter"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>
</manifest>
Output:-
Name:-Aman Verma MET – Institute of Computer Science
Roll No:1266