Reputation: 1303
Once I modified an Android app and added NFC capabilities. But it just didn't work. The "Tap to Beam" just would not appear.
Long story short. The app had:
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
Upvotes: 0
Views: 277
Reputation: 40831
Android Beam will only work if the system is permitted to take a sceenshot of your activity. Hence, if you set the FLAG_SECURE
(and consequently prevent screenshots while your activity is visible), you also prevent Android from taking the screenshot that would normally be displayed in the Beam UI. Consequently, no Beam UI will be shown and Beam will not work for your activity.
Upvotes: 1
Reputation: 1303
NFC does not seem to work, if LayoutParams.FLAG_SECURE
is set.
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
Upvotes: 2