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 7657259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:59:06+00:00 2026-05-31T12:59:06+00:00

my ImageView is always trying to re-use the same bitmap whereas whenever i tap

  • 0

my ImageView is always trying to re-use the same bitmap whereas whenever i tap (onTap ()) it ‘s supposed to go look for the right image not using the same. How can I prevent it to so??
besides, whenever i recycle it, my activity crshes when i tap again…

Please help!

my logcat gives me:

03-14 14:40:15.519 D/setting image>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>(29389): grrrrr java.lang.NullPointerException

here is my snippet :

 protected boolean onTap(int i) {
               /*   Toast.makeText(getApplicationContext(),
                                  locations.get(i).getSnippet() + " " + locations.get(i).getTitle(),
                                  Toast.LENGTH_SHORT).show();*/
                 //   mapView = (MapView) findViewById(R.id.mapView);
                  OverlayItem item=getItem(i);
                  GeoPoint geo=item.getPoint();
                  Bitmap bitmap = null;

              Point pro=    mapView.getProjection().toPixels(geo, null);
                  if (pro!=null)
                  {   View view=panel.getView();



                 /* }
                  catch (Exception e){Log.d("merde>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", "grrrrr " +e);}*/
              String capteur=   getType (locations.get(i).getSnippet()); 
                  ((TextView)view.findViewById(R.id.poptext))
                    .setText(String.valueOf("image captured by : " + capteur + "\n" + "Latitude = " + locations.get(i).getPoint().getLatitudeE6() +" " + "Longitude = "+ locations.get(i).getPoint().getLongitudeE6() +" " + 
                             "\n" + "Image can be found at the following directory :" + locations.get(i).getTitle()

                            ));

                  if (locations.get(i).getTitle()!=null){
                try {

                       bitmap = BitmapFactory.decodeFile(locations.get(i).getTitle());} catch (Exception e){Log.d("getting Title>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", "grrrrr " +e.getMessage());}
                      if (bitmap!=null){
                          try{
                              mContext=getApplicationContext ();
                             ((ImageView) findViewById(R.id.ImageV)).setImageBitmap(bitmap);



                      } catch (Exception e){Log.d("setting image>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", "grrrrr " +e);}}

                      else {}

                  }else {}
                  panel.show(true

                          );}

                  return(true);
                }
    my popup panel

class PopupPanel {
    Context mContext= getApplicationContext();
        View popup;
        boolean isVisible=false;

        PopupPanel(int layout) {
          ViewGroup parent=(ViewGroup)mapView.getParent();

          popup=getLayoutInflater().inflate(layout, parent, false);

          popup.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
              hide();
            }
          });
        }

        View getView() {
          return(popup);
        }

        void show(boolean alignTop) {
          RelativeLayout.LayoutParams lp=new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT
          );

          if (alignTop) {
            lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
            lp.setMargins(20, 20, 20, 20);
          }
          else {
            lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
            lp.setMargins(20, 20, 20, 60);
          }

          hide();

          ((ViewGroup)mapView.getParent()).addView(popup, lp);
          isVisible=true;
        }

        void hide() {
          if (isVisible) {
            isVisible=false;
            ((ViewGroup)popup.getParent()).removeView(popup);
          }
        }
  • 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-31T12:59:08+00:00Added an answer on May 31, 2026 at 12:59 pm

    one thing I can tell you right away is that e.getMessage() doesn’t really works. It’ll return null and you’ll get null pointer exception.

    update

    well, i can tell you that too,

    ((ImageView) findViewById(R.id.ImageV)).setImageBitmap(bitmap); 
    

    when you call that and say

    findViewById(R.id.ImageV)
    

    The view R.id.ImageV is inflated someplace else and what you are getting here is just an raw ref. to that view. You need to have referece to the actual view which originally inflated that view and then through that view you can call

    myOldView.findViewById(R.id.ImageV)
    

    that’ll definately solve your problem.

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

Sidebar

Related Questions

I want to flip an imageView (left/right), but I can not find a UIView
I am trying to make an imageview that rotates while sliding across the screen.
I'm trying to animate a simple ImageView in my application and I want it
I'm trying to place various size images inside imageView of UITableViewCell. I get the
Is it possible to change the orientation of an ImageView to be always PORTRAIT,
I am trying to use async requests to fetch the images from urls, to
Thanks for reading. I'm trying to use CoreImage in iOS 5 to alter the
I'm trying to make a listview with a text and an image for each
IE 8 is not refreshing a popup window that shows an image with some
I tried to get Bitmap attached to an ImageView, using ImageView.getDrawingCache(); But I 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.