Android Question Enable USB Tether

nortonir

Member
Licensed User
Longtime User
Hi
I want enable USB Tether , I use below code but did not work!! (Android 4.4.4)
why?

B4X:
Sub EnableUSBTether
   Dim cm As JavaObject = GetContext.RunMethod("getSystemService", Array("connectivity"))
   log(cm.RunMethod("setUsbTethering", Array(True)))
End Sub

Sub GetContext As JavaObject
   Dim jo As JavaObject = Activity
   Return jo.RunMethod("getContext", Null)
End Sub
 
Top