Android Question How to tell which layout is in front when device BACK button is pressed

HappyDad

Member
Licensed User
Longtime User
I have many panels each corresponds to one layout (loaded by LoadLayout).
When device BACK button is pressed, I want to close the current panel.
So I am using Activity_KeyPress to handle the BACK button press event.
But how do I tell which layout is in front?
I see in this post:
that "Select layout" is used to tell.
I tried but it doesn't work, "layout" is not recognized.
 

OliverA

Expert
Licensed User
Longtime User
layout (in that example) is a global variable. Every time you load a Layout, set this variable to the name of that Layout
 
Upvote 0
Top