Android transparent overlay without View

We’re not going to use ViewOverlay here. We’ll use Dialog instead.

The overlay does not show on button click. What I did was let the overlay appear when the activity is loaded.

First, create the XML file for the contents of that dialog overlay.

\app\src\main\res\layout\popup_content.xml

Then add the following code into your activity’s Java file. Please edit as needed in your project.

Notes:
You might need to add lines of “import” codes yourself for the classes I used.
You might need to fill in missing @color and @dimen values yourself.

app\src\main\java\com\yourpackagename\yourappname\activities\MainActivity.java

Related Posts:

Posts that may be related to "Android transparent overlay without View":

Catzie

A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *