Android Question get access to android.app.UiModeManager

RichyK68

Active Member
Licensed User
Longtime User
It can be done through the reflector object, like this:

Dim r As Reflector
r.Target = r.GetContext
Dim UIManager As Object
UIManager = r.RunMethod2("getSystemService", "uimode", "java.lang.String")

This returns a reference UiModeManager. It's a shame that the Driving Mode ability cannot be turned on and off via enableCarMode and disableCarMode.

r.Target = UIManager
r.RunMethod2("enableCarMode" ,0 , "java.lang.int")

does not throw an error but does not enable Driving Mode on the Samsung Galaxy S4. This may be because Samsung prohibit apps from doing this or I'm just doing it completely wrong :)

Richard
 
Upvote 0

RichyK68

Active Member
Licensed User
Longtime User
Sorry, yes, I've just found that it does actually turn car mode on, but it's driving mode I need to turn on :) this is a feature of the S3 and S4, but car mode is not the same thing sadly.

I'm still googling this stuff though but if you have any ideas, I'd love to hear :)

Richard
 
Upvote 0
Top