L Linostar Member Licensed User Longtime User Jun 16, 2014 #1 Hi, I am trying to disable recent apps dialog (usually open by long-pressing the home key) using the the following code: Code: Copy Sub Activity_WindowFocusChanged(Focused As Boolean) dim myPhone as Phone If Not(Focused) Then Dim i As Intent i.Initialize("android.intent.action.CLOSE_SYSTEM_DIALOGS", "") myPhone.SendBroadcastIntent(i) End If End Sub However, this is giving me a java.lang.NullPointerException error when the window loses focus. Where is the error I've committed? Thanks.
Hi, I am trying to disable recent apps dialog (usually open by long-pressing the home key) using the the following code: Code: Copy Sub Activity_WindowFocusChanged(Focused As Boolean) dim myPhone as Phone If Not(Focused) Then Dim i As Intent i.Initialize("android.intent.action.CLOSE_SYSTEM_DIALOGS", "") myPhone.SendBroadcastIntent(i) End If End Sub However, this is giving me a java.lang.NullPointerException error when the window loses focus. Where is the error I've committed? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jun 17, 2014 #2 Can you post the full error message from the logs? Upvote 0
L Linostar Member Licensed User Longtime User Jun 17, 2014 #3 Erel said: Can you post the full error message from the logs? Click to expand... Sorry. It seems the nsip I posted above was bit different from my actual code. The declaration of "myPhone as Phone" in my actual code was made in the Globals sub. When I moved it to the Activity_WindowFocusHasChanged sub, there is no longer a jaba.lang.NullPointerException error occuring, which I find pretty weird by the way. Now, although the error disappeared, the sendBoradcastIntent command isn't doing what it is supposed to do here, and I can still open the recent apps dialog by long pressing the home key. Any suggestions? Upvote 0
Erel said: Can you post the full error message from the logs? Click to expand... Sorry. It seems the nsip I posted above was bit different from my actual code. The declaration of "myPhone as Phone" in my actual code was made in the Globals sub. When I moved it to the Activity_WindowFocusHasChanged sub, there is no longer a jaba.lang.NullPointerException error occuring, which I find pretty weird by the way. Now, although the error disappeared, the sendBoradcastIntent command isn't doing what it is supposed to do here, and I can still open the recent apps dialog by long pressing the home key. Any suggestions?
Erel B4X founder Staff member Licensed User Longtime User Jun 17, 2014 #4 The home button and the recent apps button are not supposed to be disabled. Upvote 0
L Linostar Member Licensed User Longtime User Jun 17, 2014 #5 Erel said: The home button and the recent apps button are not supposed to be disabled. Click to expand... That's sad news for someone trying to develop a lockscreen app like me! Upvote 0
Erel said: The home button and the recent apps button are not supposed to be disabled. Click to expand... That's sad news for someone trying to develop a lockscreen app like me!