Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How may I use the setOnItemClickListener? #105

Open
Mardoqueu opened this issue Feb 23, 2015 · 0 comments
Open

How may I use the setOnItemClickListener? #105

Mardoqueu opened this issue Feb 23, 2015 · 0 comments

Comments

@Mardoqueu
Copy link

I am trying to use the setOnItemClickListener, but it is not working, any tips?

    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            switch (i) {
                case 0:
                    Context context = getApplicationContext();
                    CharSequence text = "It is working!";
                    int duration = Toast.LENGTH_SHORT;

                    Toast toast = Toast.makeText(context, text, duration);
                    toast.show();
                    break;
            }
        }
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant