android - how to implement a listener on specific items using ListVIew? -


I've created a ListView with a bunch of items, but I'm not really sure how the listener executes on a particular item Please. Please help me! I really want to eat it a lot.

I tried to use this code, but when I click on any item it will only bring me into the same activity.

  List.setOnItemClickListener (New OnItemClickListener) {public void onItemClick (adapter view   

But if I use this statement with the statement, then nothing is happening:

  list.setOnItemClickListener (New OnItemClickListener ( ) {Public void onItemClick (AdapterView & lt;? & Gt; Arg0, see Arg1, status of the int, long ID) {if (list.getItemAtPosition (position). Par (mStrings [0])) {intent I = new Intent (main activity., Activity 2. class); startActivity i); }}});    

You can base your status on status :

  if (position == 0) {... start activity ...}    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -