Bug? Activity_WindowFocusChanged

Tommy h

Member
Licensed User
Longtime User
Hi all,

I've a problem with Activity_WindowFocusChanged event, if I press home button to reduce my application
application raise an error: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
I can see it in b4a log tab and when I resume the application I can see it on screen.

I've reproduce it even with a new blank application:

B4X:
  Project Attributes

  Activity Attributes

Sub Process_Globals
End Sub

Sub Globals
End Sub

Sub Activity_Create(FirstTime As Boolean)
  'Carico il layout
  Activity.LoadLayout("PnlMain")
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub Activity_WindowFocusChanged(HasFocus As Boolean)
end sub

Maybe a bug or a problem with Sdk I've a Galaxy Tab 3 7.0'' Sdk 4.2.1
Any help is appreciated, thanks in advance
 

LucaMs

Expert
Licensed User
Longtime User
I get a similar error (only: "java.lang.NullPointerException") and I have a different device with different OS.

But I ask myself what is it that event: Activity_Pause is sufficient to ensure that the activity has lost focus.
 

Tommy h

Member
Licensed User
Longtime User
I get a similar error (only: "java.lang.NullPointerException") and I have a different device with different OS.

But I ask myself what is it that event: Activity_Pause is sufficient to ensure that the activity has lost focus.

I use it to hide Bar.
When users open samsung upper bar swiping down, Activity_Pause doesn't rise
 
Top