Created
February 15, 2015 21:27
-
-
Save notdrone/8f8fa1cc6df1427de51a to your computer and use it in GitHub Desktop.
list clicks and toast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
String text = (String) listView.getItemAtPosition(position); | |
int duration = Toast.LENGTH_SHORT; | |
Toast toast = Toast.makeText(getActivity(), text, duration); | |
toast.show(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment