Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. package com.mkyong.android;
  2.  
  3. import android.view.View;
  4. import android.widget.AdapterView;
  5. import android.widget.AdapterView.OnItemSelectedListener;
  6. import android.widget.Toast;
  7.  
  8. public class CustomOnItemSelectedListener implements OnItemSelectedListener {
  9.  
  10. public void onItemSelected(AdapterView<?> parent, View view, int pos,long id) {
  11. Toast.makeText(parent.getContext(),
  12. "OnItemSelectedListener : " + parent.getItemAtPosition(pos).toString(),
  13. Toast.LENGTH_SHORT).show();
  14. }
  15.  
  16. @Override
  17. public void onNothingSelected(AdapterView<?> arg0) {
  18. // TODO Auto-generated method stub
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement