I am developing one android application. In which I have some Products and form to purchase that product. In the Order form I have one Edit Text as Product ( means product name) .
In my application user has to type Product name but I want to know that Is there any way that the EditText field is autofilled with that particular Product like as in flipcart.
Any one knows then suggest me...
Thanks in advance...
When you want to populate it just call (after reading it in from the XML layout in this example):
EditText myTextBox = (EditText) findViewById(R.id.editBox);
myTextBox.setText("My Product Description");
If what you are looking for is an auto completion after they have started typing, then an AutoCompleteTextView
is your best bet, replacing the EditText and providing the auto complete functionality
There is an example of this over at the Android Developers website: http://developer.android.com/guide/topics/ui/controls/text.html#AutoComplete
you can use autocomplete textview for suggestion of your all the product names, refer this example http://saigeethamn.blogspot.in/2010/05/auto-complete-text-view-android.html
or you just want to show when app launches, use hint
android:hint="@string/enterproduct"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With