Android Question Activity WindowFocusChanged event.

Tom_707

Member
Licensed User
Hi,

I'm trying to figure out the Activity WindowFocusChanged event but there doesn't seem to be much in either the B4X or Android documentation.

When you create an Activity, you add Views to it, or load a Layout. Which part of the Activity is the Window? Is it the entire screen that contains all Views?
When does the WindowFocusChanged event fire? Is it when you swap to another App that is currently running on the Android device?

Any help will be appreciated.
 

sfsameer

Well-Known Member
Licensed User
Longtime User
if i may ask, what is your purpose of this event? why do you need it ?

based on your question and the details provided are very little, but in android and in B4A there is :

-----------------------------------------------------------
in b4a
Sub Activity_Pause (UserClosed As Boolean)

End Sub

*it fires when the activity losses the focus (Paused) + check if the user has closed the activity

In Android :

public void onPause() {

}

-----------------------------------------------------------
-----------------------------------------------------------
in b4a
Sub Activity_Resume

End Sub

*it fires when the activity regains the focus (Resumed)

In android :

public void onResume() {

}

-----------------------------------------------------------
hope that helps :)
 
Upvote 0

Tom_707

Member
Licensed User
I don't need this event as yet, I'm just learning B4A and trying to figure out what's what.
Thanks for the reply.
Now I just need to figure out what a Window is.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If the user click the home button, i´d like to return my app. is it possible?
is the user press the home button you have to respect this wish. I don´t think that you can get back to your app if you do not use KIOSK-Mode.
 
Upvote 0
Top