I have items inside a list which come through a CustomListAdapter and inside my MainActivity I am having problems getting the imageview etc out.
Inside my MainActivity I have:
CustomListAdapter adapter=new CustomListAdapter(this.getActivity(), urlArrays, images, tabType, ringImage, pseButton);
list=(ListView) rootView.findViewById(R.id.list_view);
list.setAdapter(adapter);
Using the above how can I get out items I want to set them to onClickListeners for example?
If I do this:
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
final int position, long id) {
This will set the whole row to a listener onItemClick. But I want to get for instance the pseButton and onClick do something with that. I've tried a Hashmap like this inside the onClick event above but this gives me a String cast exception:
HashMap<String, Object> obj = (HashMap<String, Object>) parent.getAdapter().getItem(position);
Object pause_button = obj.get("R.drawable.pseButton").toString();