Questions tagged [onitemclick]

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

274 questions
0
votes
3 answers

Spinner OnItemClick is not getting called in android 4.0 and above

i have one problem with android spinner onItemClickListener(). i know that onItemClickListener is not working with spinner so i just customize the spinner class and override the setOnItemClickListener() method of spinner class. following is the code…
kanchan
  • 77
  • 3
  • 11
0
votes
1 answer

How to link listView to another class when list item is selected?

Hi I am trying to make an app that shows a list of items using listView and when the user select one of the items from the list. the app will call the specific class that is link to the item selected however i encountered an error at the second…
Isabella Chan
  • 41
  • 1
  • 10
0
votes
1 answer

Get Access to BluetoothDevices from Set

I'm trying to establish a connection between Android and a Bluetooth module. I follow the instructions from http://developer.android.com/guide/topics/connectivity/bluetooth.html after "Discovering" I placed the found Devices into a ListView, which…
PhoGGy
  • 23
  • 6
0
votes
2 answers

onItemClick for custom ArrayAdapter - with recycled views

Does anyone have a good tutorial for implementing onItemClick() for a ListView populated by a custom ArrayAdapter? I'm struggling with how Android is recycling views, and how to affect the layout of the selected view (which is a RelativeLayout). The…
stephen mc
  • 751
  • 2
  • 12
  • 22
0
votes
1 answer

ListView onItemClick confusion

I've been trying to figure this out for a while now and I can't find any help online. Basically I just need to have an onItemClickListener for the items. All they will do is start a new intent to a new activity. import android.app.Activity; import…
Funkyguy
  • 628
  • 2
  • 10
  • 31
0
votes
0 answers

OnItemClick nor for all elements

I've got a ListView with 31 Items. You can click on the first 30, but not on the last one. To handle the Click Event, I use an OnItemClickListener. @Override public void onItemClick(AdapterView arg0, View arg1, int position, long arg3) { …
Simon Tenbeitel
  • 835
  • 1
  • 8
  • 20
0
votes
2 answers

Get reference to an object within a ListView

Up front: This is my first attempt at an Android app. I'm in that strange place of not knowing what to search for to find the answer to my question. What I have accomplished is: Created a custom class myCustomClass with properties of 'title' and…
0
votes
3 answers

Android: setText onItemClick NPE

I don't get why I am getting a NPE while setting a text view string. I use these all over but why a NPE on this onItemClick() method?? Thnx for your help. public void onItemClick(AdapterView parent, View view, int position, long id) { . .…
user742030
0
votes
2 answers

Identify onItemClick for two different Gallery items in Android

In my Activity, I have two Gallery items. I am implementing OnItemClickListener so I have to overwrite onItemClick method. I have set the listener as…
AnujAroshA
  • 4,623
  • 8
  • 56
  • 99
-1
votes
3 answers

ListView OnClick XML output

I am using an XML (HttpPost) on ListView to display a list of items in my application. XML File passes the following sample data: id=5 name=Name2 score=20 The problem I am facing is with the OnItemClick: public void onItemClick(AdapterView…
Ramanathan
  • 1,663
  • 4
  • 17
  • 24
-1
votes
2 answers

RecyclerView onItemClick not working, always show nullpointerexception

I checked full of Stackoverflow but i can't find solution, May be this is duplicate question but please help me. i create Interface in Adapter:- public interface OnItemClickListener { void onItemClick(int positon, AdvSearchList_Model item, View…
-1
votes
3 answers

How to send value from onItemClick RecycleView to other java class

@Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { String clicktemplate = modelClassesListt.get(i).getTitle(); Toast.makeText(Template.this ,modelClassesListt.get(i).getTitle() ,…
-1
votes
1 answer

SQLite query wrong, onItemClick making the app crash

I have a list view which I populate with names entered in a database through SQLite. When I click on one of those names the app crashes. Please, if you can find the issue, I'd be grateful. Thank you! I have added the part of the logcat that…
Srms
  • 11
  • 4
-1
votes
2 answers

java.lang.String cannot be cast to

I am trying to get a firebase database value when I click on an autocomplete suggested item. The code below is how I am trying to implement it. However, I seem to be getting a java.lang.String cannot be cast to SearchInformation error on this…
ben
  • 159
  • 1
  • 4
  • 15
-1
votes
1 answer

Weird RecyclerView behaviour onItemTouchListener

I am trying to add RecyclerItemClickListener on my RecyclerView. It works fine, thing is my 2 components that are in my RecyclerView needs to be double clicked to execute their onClick action. Here is my recyclerView.addOnItemTouchListener which is…
Montassir Ld
  • 531
  • 4
  • 12