StickerView icon indicating copy to clipboard operation
StickerView copied to clipboard

how to add image which is selected from gallary as a sticker?

Open rahul107 opened this issue 7 years ago • 1 comments

Error Accured

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference at com.example.abner.stickerdemo.view.StickerView.isInBitmap(StickerView.java:430) at com.example.abner.stickerdemo.view.StickerView.onTouchEvent(StickerView.java:288) at android.view.View.dispatchTouchEvent(View.java:9306) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198) at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737) at android.app.Activity.dispatchTouchEvent(Activity.java:2820) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364) at android.view.View.dispatchPointerEvent(View.java:9526) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4267) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4133) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3727) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3693) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3819) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3701) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3876) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3727) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3693) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3701) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3674) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5959) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5933) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5894) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6062) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:187) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:323) at android.os.Looper.loop(Looper.java:138) at android.app.ActivityThread.main(ActivityThread.java:5527) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)

rahul107 avatar Jul 18 '17 11:07 rahul107

get your selected image bitmap and set it in a stickerView using stickerView.setBitmap(bitmap);

aZyreTech avatar Jun 03 '19 06:06 aZyreTech