pyricau.github.com icon indicating copy to clipboard operation
pyricau.github.com copied to clipboard

ChatHeads no longer working on API 23

Open theunreal opened this issue 9 years ago • 1 comments

https://github.com/pyricau/pyricau.github.com/blob/master/_posts/2013-04-14-chatheads-basics.markdown

Using <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> is depraced and this permission need to be granted manually by the user

theunreal avatar Oct 05 '16 17:10 theunreal

ya that's true but when add run time check permissions this code will work as charm :) add these lines to your code,

if(Build.VERSION.SDK_INT >= 23) { if (!Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); startActivityForResult(intent, 1234); } else { Intent intent = new Intent(PassengerPickupActivity.this, OverlayService.class); startService(intent); } } else { Intent intent = new Intent(PassengerPickupActivity.this, OverlayService.class); startService(intent); }

ashanajackol avatar Jul 01 '17 04:07 ashanajackol