I'm creating Android app which sends multiple selected images onto web database
I followed the tutorial from https://demonuts.com/select-multiple-images-gallery
The problem is that above code works well on the virtual emulator device
See below image where "2 selected" and "SELECT" show up on the virtual device
But above parts of "2 selected" and "SELECT" don't show up on the actual phone
so that I can't move back to previous activity with selected images like following and I can't click the "send" button
I guess the code uses Android's built-in image selection viewer than custom xml viwer so that I can't figure out how to add "button" on that Android's built-in image selection viewer
and can't figure out where I should add "onclicklistener" with respect to that button if I can add button to Android's built-in image selection viewer
Or if there is some other way that I can implement same "multiple image selection algorithm", please suggest it in detail cause I'm new to Android development
================================================================================ Edit: The error log when I click SELECT button on the actual phone
I/art: Starting a blocking GC Alloc
Starting a blocking GC Alloc
I/art: Alloc sticky concurrent mark sweep GC freed 4(448B) AllocSpace objects, 0(0B) LOS objects, 7% free, 89MB/96MB, paused 488us total 7.373ms
Starting a blocking GC Alloc
I/art: Clamp target GC heap from 105MB to 96MB
Alloc partial concurrent mark sweep GC freed 6(144B) AllocSpace objects, 0(0B) LOS objects, 7% free, 89MB/96MB, paused 511us total 26.117ms
Starting a blocking GC Alloc
I/art: Clamp target GC heap from 105MB to 96MB
Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 7% free, 89MB/96MB, paused 542us total 42.448ms
Forcing collection of SoftReferences for 7MB allocation
I/art: Starting a blocking GC Alloc
I/art: Clamp target GC heap from 105MB to 96MB
Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 7% free, 89MB/96MB, paused 533us total 42.342ms
Starting a blocking GC HomogeneousSpaceCompact
I/art: Clamp target GC heap from 105MB to 96MB
HomogeneousSpaceCompact marksweep + semispace GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 7% free, 89MB/96MB, paused 45.430ms total 45.430ms
W/art: Throwing OutOfMemoryError "Failed to allocate a 7784024 byte allocation with 7276856 free bytes and 6MB until OOM"
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.prototype, PID: 4943
java.lang.OutOfMemoryError: Failed to allocate a 7784024 byte allocation with 7276856 free bytes and 6MB until OOM
at java.lang.StringFactory.newStringFromBytes(StringFactory.java:185)
at java.lang.StringFactory.newStringFromBytes(StringFactory.java:63)
at android.util.Base64.encodeToString(Base64.java:456)
at com.example.prototype.UploadMultiplePicturesActivity.imageToString(UploadMultiplePicturesActivity.java:330)
at com.example.prototype.UploadMultiplePicturesActivity.onActivityResult(UploadMultiplePicturesActivity.java:293)
at android.app.Activity.dispatchActivityResult(Activity.java:7028)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4217)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4264)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1602)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6351)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)