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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:30:03+00:00 2026-06-17T17:30:03+00:00

I have been looking all over stackoverflow to find a solution, but I haven’t

  • 0

I have been looking all over stackoverflow to find a solution, but I haven’t found it. So now I want to say sorry if duplicate is found. Now that I have said that, let’s get some code and problems:

I am trying to load an ImageView into my Activity, but I keep getting a nice blue debug log in my logcat saying "imageview == null"

if (imageview == null) { 
    Log.d(TAG, "imageview == null");
 } else {
    imageview.setImageBitmap(bm); }`

which just checks if my ImageView is null or not (and sets an image into it if not null). I try load it in the onCreate method:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.confirmpicture);
    String str = getIntent().getStringExtra("GalleryImage");
    Log.i(TAG, "Got " + str + " from the intent");
    Bitmap bm = BitmapFactory.decodeFile(str);
    imageview = (ImageView) findViewById(R.id.galleryPicture);
    if (bm != null) {
        if (imageview == null) {
            Log.d(TAG, "imageview == null");
        } else {
            imageview.setImageBitmap(bm);
        }
    } else {
        Log.d(TAG, "Bitmap not decoded");
    }

My head keeps asking me: “Did you declare the ImageView in the xml file, you fool?” and I keep checking the xml file which contains

<ImageView
    android:name="@+id/galleryPicture"
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:layout_below="@id/confirmText"
    android:contentDescription="description comes here...." />

I am targetting API 8 (Android 2.2) and I have been trying to fix this problem about loading the ImageView for days now. Fixed now

  • 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-17T17:30:04+00:00Added an answer on June 17, 2026 at 5:30 pm

    You should write android:id="@+id/galleryPicture" in the xml file, not android:name="@+id/galleryPicture". There is no view with id galleryPicture in the layout file you created.

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

Sidebar

Related Questions

So I have been looking all over and I haven't quite found what I
I have been looking all over the internet and i found some good guides
I've been looking all over the place, but I haven't landed an answer yet.
I have been looking for a while now but I can not find an
I have been looking all over google to find some answers to my questions
I have been looking all over google to find what the hex output of
I have been looking all over the internet and stackoverflow for a concrete answer
I've been researching all over the web but haven't found any conclusive answer to
I have been looking all over the web for the simplest solution for this,
I have been looking all over MSDN and can't find a reason why Thread

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.