Posts

Showing posts with the label SearchView for String List

SearchView for String list in Sketchware

Image
To implement a SearchView for a simple ListView showing a String list in Sketchware, follow the steps given below. 1. Create a new project in Sketchware. 2. In VIEW area add a ListView listview1 . 3. Switch On AppCompat and Design. 4. Create a String List list . 5. Create a more block extra . 6. In the more block extra , use an add source directly block and put codes to declare a SearchView searchview and an ArrayAdapter adapter . After that add the SearchView as an OptionsMenu item. } android.support.v7.widget.SearchView searchview; ArrayAdapter<String> adapter; @Override public boolean onCreateOptionsMenu( Menu menu) { menu.add(0,0,0,"search").setActionView(searchview).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); return true; } { 7. In onCreate event, add items to the String List list . 8. After adding items to the list use add source directly blocks and put following codes: i. Define the ArrayAdapter and set it as adapter of L...