Android Question Freeze when using WebView to show large images

Toley

Active Member
Licensed User
Longtime User
Hello, I'm using this code snippet to show large images. https://www.b4x.com/android/forum/threads/b4x-use-webview-to-show-large-images.102910/
I know there is a better alternative linked at the top of the thread, but for now that one is enough for my needs.

The problem is if I long touch the image (3 sec+), a small copy of the image appear where I long touch and the tablet freeze. The only way to get back is to do a power cycle.
I join a screenshot of the frozen image and a minimal project to test it.

P.S. : If the only solution is to use the "better alternative" then I will try to implement it.

Thanks for any help.

Edit: I just realize files are too big for uploading directly. So here is the link.
 
Last edited:

Toley

Active Member
Licensed User
Longtime User
I've try the alternative and I cannot use it because the image can be moved outside the border of the view.
So the original code has to be fixed or I will have to find a totally different solution.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem is if I long touch the image (3 sec+), a small copy of the image appear where I long touch and the tablet freeze. The only way to get back is to do a power cycle.
I join a screenshot of the frozen image and a minimal project to test it.
This doesn't happen in B4A framework code. WebView is a native view and it looks like you are hitting an OS bug.

Switch to ZoomImageView.
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Thank you @Erel for the suggestion but with this one too I can move the image outside the view and I don't want this. See attachment.
 

Attachments

  • Screen_2026_06_16_08_23_53.png
    Screen_2026_06_16_08_23_53.png
    424.2 KB · Views: 63
Upvote 0

Toley

Active Member
Licensed User
Longtime User
I managed to solve my problem. By default it use Chrome Webview. With the help of IA (to find the ADB commands) I was able to switch to Android System Webview. I don't have the problem anymore. Thanks to all.
 
Upvote 0
Top