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

  • Home
  • SEARCH
  • 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 5840029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:40:43+00:00 2026-05-22T11:40:43+00:00

I need to be able to click an imgview in a listview , which

  • 0

I need to be able to click an imgview in a listview, which should open a popup showing the image fullsize. I’ve managed to implement the clicklistener, but keep failing at creating the popup, even with just a testing textview.

In my mainActivity oncreate i run

lstView.setAdapter(new CustomListViewAdapter(this, dataFromDBListe, 0, orientation));

In my CustomListVievAdapter, where i have my clicklistener (which can display a toast at the moment) I have the following getView():

public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.custom_row, null);
        holder = new ViewHolder();
        holder.title = (TextView) convertView.findViewById(R.id.title);
        holder.prev = (TextView) convertView.findViewById(R.id.prevNrDate);
        holder.prevTitle = (TextView) convertView.findViewById    (R.id.prevTitle);
        holder.next = (TextView) convertView.findViewById(R.id.nextNrDate);
        holder.nextTitle = (TextView) convertView.findViewById     (R.id.nextTitle);
        holder.picture = (ImageView) convertView.findViewById    (R.id.showPic);
        holder.prevFast = (TextView) convertView.findViewById(R.id.prev);
        holder.nextFast = (TextView) convertView.findViewById(R.id.next);
        holder.linearLayout = (LinearLayout) convertView.findViewById    (R.id.imgLay);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    testSort(holder);
    final Show item = showList.get(position);
    holder.title.setText(item.getTitle());
    holder.prev.setText(item.getPrevNr() + " - " + item.getPrevDate());
    holder.prevTitle.setText(item.getPrevTitle());
    holder.next.setText(item.getNextNr() + " - " + item.getNextDate());
    holder.nextTitle.setText(item.getNextTitle());

    if(pic) {
        holder.linearLayout.setVisibility(8);
    } if(compact) {
        holder.linearLayout.setVisibility(8);
        holder.prevTitle.setVisibility(8);
        holder.nextTitle.setVisibility(8);
    } else {
//          new DownloadImageTask(holder.picture).execute(item.getShowId());
        String path;
        if(ih.checkImg(item.getShowId())) {
            path = PATH + item.getShowId() + ".jpg";
        } else {
            path = "bla";
        }
//          DrawableManager dm = new DrawableManager();
//          dm.fetchDrawableOnThread(path, holder.picture);
        imageDownloader.download(path, holder.picture);
//          ih.download(path, holder.picture);
    }

    holder.picture.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                    Toast.makeText(context, "IMG clicked",
                            Toast.LENGTH_LONG).show();
                    //Show popup with full image of the clicked small img.
                }
            });

    return convertView;
}

I tried most of the commonly linkedto solutions in here for popupwindow, but can’t make it work.

  • 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-05-22T11:40:43+00:00Added an answer on May 22, 2026 at 11:40 am

    Create custom-dialog and pass image in it….

    private void loadPhoto(ImageView imageView, int width, int height) {
    
            ImageView tempImageView = imageView;
    
    
            AlertDialog.Builder imageDialog = new AlertDialog.Builder(this);
            LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    
            View layout = inflater.inflate(R.layout.custom_fullimage_dialog,
                    (ViewGroup) findViewById(R.id.layout_root));
            ImageView image = (ImageView) layout.findViewById(R.id.fullimage);
            image.setImageDrawable(tempImageView.getDrawable());
            imageDialog.setView(layout);
            imageDialog.setPositiveButton(resources.getString(R.string.ok_button), new DialogInterface.OnClickListener(){
    
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
    
            });
    
    
            imageDialog.create();
            imageDialog.show();     
        }
    

    custom_fullimage_dialog.xml:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_root" android:orientation="horizontal"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:padding="10dp">
        <ImageView android:id="@+id/fullimage" android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </ImageView>
    
        <TextView android:id="@+id/custom_fullimage_placename"
            android:layout_width="wrap_content" android:layout_height="fill_parent"
            android:textColor="#FFF">
        </TextView>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.