Questions tagged [onitemclick]

OnItemClick is a callback method invoked when an item in an Android AdapterView has been clicked.

274 questions
1
vote
2 answers

when listview's item is click,how to make its view color to be red, others is black?

please look at the picture. this is listview, its item is a textview, I want to result is that when I click the item ,its textview's color turn to red,and all of others have no selected is black. listview.setOnItemClickListener(new…
Json zhang
  • 119
  • 14
1
vote
0 answers

onItemClick with toast content of an array list

What I need is a toast or something like that with content of an array list, that opens when I click on a LinearLayout item. But I don't know how to implement it with the holder view. public class CanteenListAdapter extends BaseAdapter implements…
nolags
  • 633
  • 1
  • 11
  • 30
1
vote
2 answers

ItemClick on ListView in xamarin for android

I'm developing app for android which is basically a news feed reader and got stuck. I'm parsing xml from one website and for now I have a listview in which I represented title, date, writer and so on but now when user clicks on one of the items I…
Yupi
  • 4,402
  • 3
  • 18
  • 37
1
vote
1 answer

onItemClick not working for Card View

It uses retrofit 2.0 to fetch the data from the webservice and bind it to the card view. When I click on the card view having image and textviews, on click is not triggering, rather a strange behaviour is at the very corner edges of the card view…
1
vote
3 answers

List view performItemClick doesn't work

I'm trying to call onItemClick manually when my fragment first starts up but it does not behave the way expected.It was called in the onCreateView() method as follows: public View onCreateView(LayoutInflater inflater, ViewGroup container, …
Lew Wei Hao
  • 763
  • 1
  • 13
  • 25
1
vote
3 answers

Handling items on RecyclerView OnClick Method

I am trying to make a biography app which includes cardviews. I can not achieve that when I click on each item on RecyclerView, second activity which contains of detail info must be opened. Here is my code. Where am I doing wrong? Thank you so…
1
vote
1 answer

xamarin.android navigation drawer list not detecting ItemClick Events

I have successfully created a custom side navigation menu with icons. I now want to detect item click events on the list so as to start new activities from the dashboard activity but the SelectItem method does not fire on item click. This is my…
John Owuor
  • 63
  • 1
  • 6
1
vote
1 answer

Show a detail fragment when clicking an item in a ListFragment in Android Studio

My app has a tab bar that should be visible at all times. The first tab contains a ListFragment. When I click on an item within, it loads a new activity that creates a detail fragment displaying the contents of the object in the list. I would like…
Matt Mac
  • 437
  • 8
  • 22
1
vote
0 answers

onItemClick giving wrong position in gridview

I found this question: GridView with a baseAdapter: onItemClick giving wrong position I have the same problem! Does anyone have a good solution to this?
David
  • 247
  • 2
  • 3
  • 9
1
vote
1 answer

Java - How to run function on spesific list item

please help me. I am beginner in android java and I stuck with this code. I have a list item and I want to put exit app button/menu on this. I just need to run a function to exit app AppExit(); My xml file:
1
vote
3 answers

get string value from item clicked in a listView

Hi i am new to android programming, i have make an Http post request to get json data from an external sql database and displayed my result in a lisView. i want to be able to retrieve the string value from a clicked item in the listView. Please any…
Shoogarh
  • 9
  • 1
  • 6
1
vote
1 answer

Can't get the right id into the Fragment

I need to transfer the value of id parsed from JSON entity by row click ex.(first item in the listview has id of 861(which is gotten from JSON) second one 823, I need to transfer the right id to the FrafmentB This is how I'm getting the…
Alex
  • 47
  • 8
1
vote
2 answers

Delete or hide a row in a list view

Hello everyone I have a problem in regards with the deletion or hiding of list in a list view something like .hide() in javascript . I know there are lots of answers here about it but it seems It didn't answer my problem. To explain clearly, below…
Hope
  • 644
  • 2
  • 6
  • 21
1
vote
2 answers

Making onClick of SimpleCursorAdapter

I am using this code to get data from database & showing it directly to the custom listview which displays properly. This is how I did it using SimpleCursorAdapter public void queryArticles(String querytext,Context mContext) { SQLiteDatabase…
1
vote
2 answers

OnItemClick and item view

I am actually facing a problem that I dont know how to solve... In fact, I want to change color and display a picture on a listView when I click on it. The problem is when I click my first item, the 0th , 9th, 18th etc... change too... it's just…
mfrachet
  • 8,772
  • 17
  • 55
  • 110