Hi All
I need to get some help converting some java to B4A. Here the link http://stackoverflow.com/questions/33422325/how-to-hide-headset-icon
It nedd to uses reflection as mentioned in the link.
Here's the code:
Thanks
John.
I need to get some help converting some java to B4A. Here the link http://stackoverflow.com/questions/33422325/how-to-hide-headset-icon
It nedd to uses reflection as mentioned in the link.
Here's the code:
B4X:
AudioManager manager =(AudioManager) aContext.getSystemService(Context.AUDIO_SERVICE);
try{int deviceType =AudioSystem.DEVICE_OUT_WIRED_HEADSET;
// turn off headset
int state =0;
Class<?> cl =Class.forName("android.media.AudioManager");
Method method = cl.getMethod("setWiredDeviceConnectionState",newClass[]{Integer.TYPE,Integer.TYPE,String.class});
method.invoke(manager,newObject[]{ deviceType, state,"device"});}
catch(Exception e)
{ iLog.error("disableHeadset, exception {}",ExceptionUtils.getStackTrace(e));}
Thanks
John.