In Marshmallow this code is not working with GearVR. Activity.onResume()
code
IntentFilter intentFilter = new IntentFilter("android.intent.action.proximity_sensor");
mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getType().equals("1"))
{
Log.v(LOGTAG,"headset mounted");
}
else
{
Log.v(LOGTAG,"headset unmounted");
}
}
};
this.registerReceiver(mReceiver, intentFilter);
}
this is used to detect GearVR mounted and unmounted. It was working in S6 Lollipop.
Probably this is bug in Marshmallow 6.0.1 link. Any workaround this problem? related links link1 link2
Please share anything that help me in detecting GearVr mount and unmount