question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setImageBitmap not working !

See original GitHub issue

Hello, First thank you for the effort you made on this project, it works smoothly and efficiently. The problem occurs when trying to load an image manually :

ImageView testingArea = (ImageView) findViewById(R.id.testingArea);
CircleImageView profilepic = (CircleImageView) findViewById(R.id.profilepic);

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
     ...

    testingArea.setImageBitmap(bm); // works fine
    profilepic.setImageBitmap(bm); //doesn't work
}

Note : the bitmap size was reduced and scaled, so i think the size causes no problem in this case.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hdodenhofcommented, Oct 26, 2016

Well, it seems findViewById(R.id.imgAvatar) fails and returns null. Make sure your layout actually contains a view with that ID.

0reactions
praveenverma720commented, Jan 5, 2018

I also have faced same problem but i solved it. Actually we are trying to set Image on null object that is (R.id.imageAvatar) here imageAvatar is from Different layout ,So check your proper layout object and id. Hope you will get result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - setImageBitmap() is not working - Stack Overflow
Uri selectedImage = data.getData(); Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(selectedImage)); imagePromo.
Read more >
ImageView - Android Developers
To learn more about working with Bitmaps, see: Handling Bitmaps. ... FOCUS_DOWN If the reference refers to a view that does not exist...
Read more >
imageView.setImageBitmap is not working in android - iTecNote
solved by Emil thx. I have following in my main package com.example.surfacetest; import android.os.Bundle; import android.app.
Read more >
android.widget.ImageView.setImageBitmap java code examples
How to use. setImageBitmap. method. in. android.widget.ImageView · Best Java code snippets using android.widget.ImageView.setImageBitmap (Showing top 20 results ...
Read more >
Displaying Images with the Picasso Library
Otherwise, you will consume extra memory, experience sluggish scrolling, or encounter out of memory issues if you render a lot of pictures. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found