Code example for ListView

Methods: getAdapter

0
    } 
  } 
   
  public void onListItemClick(ListView parent, View v, int position,
                  long id) {
    selection.setText(parent.getAdapter().getItem(position).toString());
  } 
     
  @Override 
  public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(Menu.NONE, LOCAL_SEARCH_ID, Menu.NONE, "Local Search")
            .setIcon(android.R.drawable.ic_search_category_default);
    menu.add(Menu.NONE, GLOBAL_SEARCH_ID, Menu.NONE, "Global Search")
            .setIcon(R.drawable.search)
            .setAlphabeticShortcut(SearchManager.MENU_KEY);
   
    return(super.onCreateOptionsMenu(menu));
  } 
 
  @Override 
  public boolean onOptionsItemSelected(MenuItem item) {