Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

setPaletteDrawable(Drawable drawable) throws a nullpointer #1

Closed
BeaYeah94 opened this issue May 13, 2018 · 1 comment
Closed

setPaletteDrawable(Drawable drawable) throws a nullpointer #1

BeaYeah94 opened this issue May 13, 2018 · 1 comment

Comments

@BeaYeah94
Copy link

Hi, when I make a photo with the camera and try to set it as the palette image it thorws a nullpointer exception. I have checked and neither of the object are null so I think is a library Issue.
Here is my code:

Bitmap bmp = MediaStore.Images.Media.getBitmap(getContext().getContentResolver(), imageUri);
ImageView im = new ImageView(getContext());
im.setImageBitmap(bmp);
photoCompare.setPaletteDrawable(im.getDrawable());

And the error:

Caused by: java.lang.NullPointerException
at android.view.ViewGroup.addView(ViewGroup.java:3353)
at android.view.ViewGroup.addView(ViewGroup.java:3336)
at com.skydoves.multicolorpicker.MultiColorPickerView.setPaletteDrawable(MultiColorPickerView.java:359)
at com.beayeah.match.match.JudgeFragment.onActivityResult(JudgeFragment.java:269)
at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:156)
at android.app.Activity.dispatchActivityResult(Activity.java:5423)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3359)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3406) 
at android.app.ActivityThread.access$1300(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5019) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 

@skydoves
Copy link
Owner

It's fixed at v.1.0.6.
Thank you for your issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants