Sathish Kumar
Sathish Kumar

Reputation: 71

In Android hide some of the texts or views from recent app view

In android For security reasons I want to hide some of the texts or views , when app is moved to recent apps in task manager. I tried to handle this by below ways but before going to the lifecyle it takes the screen shot for recent app view.
1. Inside onPause()
2. Inside onWindowFocusChanged()
3. Inside onUserLeaveHint()

All the above called after screen shot taken for recent apps 1. Its never been called onCreateThumbnail() (I don't want to hide complete screen, only the textviews has to be hidden) Please anyone have a solution for this issue ?

In Android 8.0 its doing after on pause but earlier versions how to handle.

Upvotes: 0

Views: 1582

Answers (1)

Montwell
Montwell

Reputation: 545

The way I do it is by calling

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);

after setContentView(R.layout.yours) in onCreate().

Upvotes: 4

Related Questions