Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.app.Activity;
- import android.view.View;
- import android.widget.AdapterView;
- import android.widget.Spinner;
- import android.widget.Toast;
- public class SpinnerItemSelectedListener implements Spinner.OnItemSelectedListener {
- public Activity activity;
- public SpinnerItemSelectedListener(Activity activity) {
- this.activity = activity;
- }
- @Override
- public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
- Toast.makeText(activity, "Spinner: " + adapterView.getItemAtPosition(i).toString(), Toast.LENGTH_LONG).show();
- }
- @Override
- public void onNothingSelected(AdapterView<?> adapterView) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement