Android proximity sensor issue only in Samsung devices

核能气质少年 提交于 2019-11-28 11:13:44

So turns out this is a registered issue with Samsung devices, here is a collection of pages which could help anybody facing this:

  1. Use onWindowFocusChanged. This made sense to me and my implementation related to onPause() was successful on following the same.
    Source and Explanation: activity-onpause-to-handle-focus
    What helped me: instead of in onPause();

    @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if(!hasFocus){ clearProximityListeners(); } }

  2. Issue 74464:Activity#onPause called without Activity#onResume, or can Context#registerReceiver failed

  3. More reference:
    From quite a different aspect, Bug on unregister...Otto bus.. quote: For us, this only appears on Samsung devices. And after a quick search,...

Please edit, correct, improve the answer if there's any more clarity to it.. hope it saves some time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!