MotionViews-Android
MotionViews-Android copied to clipboard
Remove entity
hay uptech, this is so awesome app for adding sticker/text to our own image. But , how can I delete entity ?? since your app doesn't include delete feature. ..
Once you have selected any entity, you can delete by calling "motionView.deletedSelectedEntity()" method.
I want to adding bitmap file as sticker, and I put this in my code : `private void addImage(final Bitmap bitmap) { motionView.post(new Runnable() { @Override public void run() { Layer layer = new Layer(); ImageEntity entity = new ImageEntity(layer, bitmap, motionView.getWidth(), motionView.getHeight());
motionView.addEntityAndPosition(entity);
}
});
}`
But, error was occured. It gives me :
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference at team.uptech.motionviews.widget.entity.ImageEntity.<init>(ImageEntity.java:24) at team.uptech.motionviews.ui.MainActivity$3.run(MainActivity.java:111) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5441) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Could you help this ? How could I set bitmap as same as sticker ?
@dimasvm seems like your Bitmap is released somewhere. Track plz where it could happen.