How to add FLAG_SECURE to PopupWindow - java

How to add FLAG_SECURE to Popup Window?
I set window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) on Activity,
But when I capture screen, only the PopupWindow showing.
Can I set WindowManager.LayoutParams.FLAG_SECURE to PopupWindow?

Related

Clear focus of BottomSheetDialog

I have a ListView in my layout. I have attached onItemClickListener for ListView to listen for item clicks. Whenever I will click on the item of it, a BottomSheetDialog will inflate. The problem is, that I want the content outside bottomsheetdialog to be clickable and scrollable. Whenever I inflate BottomSheetDialog, the content outside it becomes unresponsive. It doesn't respond to clicks, scroll etc. How can I make the content outside it to still be clickable and scrollable?

Overflow menu in listview items

I have Listview. And I want to add overflow menu to each listview's item. How to do it? Now I add button to every item and show dropdown menu when user clicks on this button. But I want to replace this ordinary button with overflow one.
Add an ImageView or Button to trigger the menu on the right of your listview items. To get the "overflow" icon, see this question: How do I get a copy of the Android overflow menu icon?
Add an onClickListener to your ImageView or Button
On your onCreate() method, create a popup menu like this:
popupMenu = new PopupMenu(this, findViewById(R.id.anchor));
popupMenu.getMenu().add(...);
popupMenu.setOnMenuItemClickListener(this);
In your onClickListener trigger the display of the popup menu
popupMenu.show();

How to display pop up menu for Dynamically created Imageviews

I am Creating a ImageViews dynamically now i need to display pop up menu if click the ImageView.
ex: In that pop up i will add download. If i click that download button respective Image should download.
I'm not very sure about putting a button on an imageview...take a look at this answer:
Put a button over an ImageView
As for making a popup appear on button click, use dialogfragments.

How to change the button with a spinner in actionbar to loading?

I have a webview and want to listen its loading event and I have a refresh button on my actionbar.
How to change the button to a spinner programmatically?
You can't magically change a button into a spinner. What you can do is disable the button and enable the spinner.
myButton.setEnabled(false);
mySpinner.setEnabled(true);
If you want to make the spinner take the place of the button, then you're going to have to put all of your layout drawing routine into a buildLayout() (or whatever you want to call it) and redraw the entire layout with a button or with a spinner, depending on the state of your application.

Android popupwindow outsidetouchable and ontouch listener

Hi I have a popupwindow on my project.
I want these;
The outside of popupwindow will be touchable and
The popupwindow will be dissmiss when clik on popupwindow.
Actualy I want to use this like
Full screen back button.
I have a full screen button. it makes some components to full screen.
I want to put a popup button full go back from fullscreen view.
How can I do this ?
Sorry for bad english.
Thanks...

Categories