<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.razormist.simpleautocompletelist.MainActivity"> <AutoCompleteTextView android:id="@+id/act_list" android:layout_alignParentStart="true" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:ems="14" android:layout_alignParentTop="true" android:layout_marginTop="80dp" android:layout_height="wrap_content" android:hint="Enter Here"/> android:id="@+id/btn_search" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/act_list" android:text="Search"/> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.razormist.simpleautocompletelist"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:configChanges="orientation" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
private AutoCompleteTextView autoCompleteTextView; String[] languages = {"C", "C++", "C#", "PHP", "Python", "Java", "BASIC", "Pascal", "Perl", "Ruby", "VB", "Scala"};
autoCompleteTextView = (AutoCompleteTextView)findViewById(R.id.act_list); ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.select_dialog_item, languages); adapter.sort(new Comparator<String>() { @Override return lhs.compareTo(rhs); } }); autoCompleteTextView.setThreshold(1); autoCompleteTextView.setAdapter(adapter); @Override if(!autoCompleteTextView.getText().toString().equals("")){ Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show(); } } });
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.