I created an app that has a function for choosing images from the smartphone gallery for positioning them in the app.
It works, except on some devices (such as Huawei Mate 20 Lite and Xiaomi Note 9 Pro) where the aforementioned function does not work, and even causes the following error:
“Attempt to invoke virtual method ‘android.graphics.Bitmap android.graphics.drawable.BitmapDrawable.getBitmap ()’ on a null object reference”
How can I solve? Here are the blocks I use to take the images and place them in the app
unfortunately without the cropimage extension, I cannot crop a perfect square and modulate it with my finger on the screen without totally distorting it (I need that whatever way you set it with your finger, it always stays square).
Is there any way to achieve this same effect without the extension?