List wont trigger onClickListener
In my application I am simply providing my list with
SimpleArrayListAdaptor and it provided my array to the list quit easily
but now when I select an item I can not see my Toast notification letting
me know which item was clicked.
My Adaptor and Click Listener:
StableArrayAdapter adapter = new
StableArrayAdapter(PFAListGallery_Activity.this,
android.R.layout.simple_list_item_1, list);
galleryList.setAdapter(adapter);
galleryList.setOnItemClickListener(new
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Log.d(tag, "Being Clicked Properly");
String selectedFromList =(String)
(galleryList.getItemAtPosition(position));
Toast.makeText(getApplicationContext(), "Item clicked
at index:" + selectedFromList,
Toast.LENGTH_SHORT).show();
}
});
}
What would be causing this issue and how can I solve it? Much appreciation
with any help! :)
No comments:
Post a Comment