braintree / android-card-form

A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
MIT License
366 stars 128 forks source link

Cant take screenshots #44

Closed Sutheres closed 6 years ago

Sutheres commented 6 years ago

Issue description

I put getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);in onCreate of my Activity that holds the cardForm. Still cannot take screenshots. Am I missing something?

quinnjn commented 6 years ago

This should work. It should be after the CardForm#setup(Activity). That method is where the FLAG_SECURE gets set.

Even without this line, you should be able to take screenshots using an emulator.

You'll want to be careful with releasing your Android app that has this flag cleared. Ideally production apps shouldn't be able to take screenshots.

crookedneighbor commented 6 years ago

For reference: https://github.com/braintree/android-card-form/blob/960d8af2abe69cd369bb0ade8ee4bb500de35a0b/CardForm/src/main/java/com/braintreepayments/cardform/view/CardForm.java#L205