Android - Event Handling

> Android

1 - About

Views object handle events.

Advertising

3 - Example

listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String message = (String) parent.getItemAtPosition(position);
                Context context = getContext();
                CharSequence text = message;
                int duration = Toast.LENGTH_SHORT;
                Toast toast = Toast.makeText(context, text, duration);
                toast.show();
            }
        });

with: