P PaulR Active Member Licensed User Longtime User Jul 31, 2012 #1 Hi, has this been implemented in any library in b4a, or is there a way of accessing this method using the Reflection library? Thanks for any help, Paul
Hi, has this been implemented in any library in b4a, or is there a way of accessing this method using the Reflection library? Thanks for any help, Paul
Erel B4X founder Staff member Licensed User Longtime User Jul 31, 2012 #2 Here: B4X: Sub IsWiredHeadsetOn As Boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String") Return r.RunMethod("isWiredHeadsetOn") End Sub Upvote 0
Here: B4X: Sub IsWiredHeadsetOn As Boolean Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod2("getSystemService", "audio", "java.lang.String") Return r.RunMethod("isWiredHeadsetOn") End Sub