Android Question Storage on Android 4.4

Spright

Active Member
Hi I got a problem with getting this library to work on my old Kitkat tablet (a Huawei Mediapad).

I use the External Storage Browser example and the example works on my Android 7.0 phone and everything newer but not on this 4.4 tablet, is there a way to get it to support older devices too? The example produce no error but nothing happens as you press the button?

In the log it prints out:

onActivtiyResult wi is null
Activtiy(main) Resume ""
Activtiy(main) Pause, Userclosed = "false"
 

DonManfred

Expert
Licensed User
Longtime User
You don´t need the class on such old Android.
Declare the permission in the Manifest, request permission for external storage (runtimepermissions) at runtime and access the files.
 
Upvote 0

Spright

Active Member
Thanks. I don't have money to get a new tablet also I love to develop on it so I'm trying to get the code to work on it.
I have never used external files without this class so I'm clueless on how to implement the details. I thought runtime-permissions needed Android 6 or higher.
 
Upvote 0

Spright

Active Member
Here, I got some help from the forum and solved it. I can't remember if I had to edited a few lines so should include the zip in case others have the same problem. It will give some red text I'm not sure why it gives such warnings but this code works in both 7.0 and 4.4 perfectly.

I don't have the red warnings available right now as text, but I will include a screenshot for as a quick reference.
 

Attachments

  • ContentChooserExample.zip
    6 KB · Views: 101
  • redtext.jpg
    redtext.jpg
    173.4 KB · Views: 89
Upvote 0
Top