Check if the XML layout is currently displayed?

When using a broadcast receiver to load the xml layout on screen (when an event occurs). Sometimes the xml is not displayed even though the receiver catches this event.

Is there a check I can perform to see if a specific xml layout is displayed on the atm screen?


source to share

2 answers

For me, your question reads as if you want to get the getContentView () method, which, unfortunately, Activity does not have. In these questions, you can find two alternative solutions to this problem:

Why isn't there a getcontentview method for the activity?

Is there any getContentView method like setContentview?



If you're talking about making the view visible. Follow these steps.

First make the GONE look like you want in XML (don't make them invisible as they block space). write the following in xml view



When you receive the broadcast, make them visible with



Hope for this help



All Articles