Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:24:10+00:00 2026-06-14T15:24:10+00:00

I am developing an Android app, which retrieves some images from the internet and

  • 0

I am developing an Android app, which retrieves some images from the internet and put them on a ListView. When one of the images is clicked, another activity is created with some details about the image. The problem is that I am not being able to track the clicks on the list.

Activity.java

public class MyActivity extends ListActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_layout);
        // List<FlickerPicture> pictures = ...
        ListView listView = (ListView) findViewById(android.R.id.list);
        listView.setOnItemClickListener(new OnItemClickListener() {
             public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                 Log.d("MyActivity", "You clicked on " + arg2);
                 Toast.makeText(getBaseContext(), "You clicked on " + arg2,
                 Toast.LENGTH_LONG).show();
             }
         });
        ArrayAdapter<FlickerPicture> adapter = new FlickrItemAdapter(this, pictures);
        listView.setAdapter(adapter);
    }
}

FlickrItemAdapter

public class FlickrItemAdapter extends ArrayAdapter<FlickerPicture> {
    public FlickrItemAdapter(Activity activity, List<FlickerPicture> pictures) {
        super(activity, 0, pictures);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Activity activity = (Activity) getContext();
        LayoutInflater inflater = activity.getLayoutInflater();
        // Inflate the views from XML
        View rowView = inflater.inflate(R.layout.miniature_layout, null);
        FlickerPicture picture = getItem(position);
        // Load the image and set it on the ImageView
        ImageButton imageButton = (ImageButton) rowView.findViewById(R.id.miniature_picture);
        try {
            imageButton.setImageBitmap(Util.loadBitmap(picture.getMiniatureLink()));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return rowView;
    }
}

Question

How do I do to make the images on my list “clickable”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:24:12+00:00Added an answer on June 14, 2026 at 3:24 pm

    You are using an ImageButton not an ImageView. Simply change miniature_layout.xml and your adapter’s getView() to use an ImageView, because the ImageButton is consuming the click event preventing it from reaching the ListView.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android app (only Widget) which displays some images from a
I am into developing an android app which fetches images from server. A single
I am developing an android app in which i need to display images after
I'm currently developing an Android app, which loads events from a server using JSON
I am developing an android app which fetches/uploads data from/to the web service every
I am developing an android app in which I have 3 spinners populated from
I am developing an android app which has a button in one activity and
I am developing an android app which needs to activate the GPS. I read
I am developing an Android app which gets an image encoded in base 64
I'm developing an Android app which is a quiz. On the other hand, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.