Android Question intent.action.CLOSE_SYSTEM_DIALOGS

JTmartins

Active Member
Licensed User
Longtime User
I've been trying to close system dialogs for a kioskmode app in android 5.

I've tryed with phone library (trough Intent), inline Java and broadcast receiver and several manifest file configurations.

None of them is firing. So i must be doing something very wrong as the only thing I managed to get fired is the activity focusChaged when the dialogs come up.

I'm new to this intent things and I am a little in the dark here.

Basicly I want to close the Poweroff dialog as soon as it popus up and also prevent a few others to apear. Device is rooted and power off is done trough a button in the app and all keyboard are custom made.

Many thanks.

The most obvious choice apears to be as below...but no luck.

B4X:
Sub Activity_WindowFocusChanged(HasFocus As Boolean)
    ToastMessageShow("focus changed",False)
    If HasFocus=False Then
      Dim i As Intent
      Dim p As Phone
      i.Initialize("android.intent.ACTION_CLOSE_SYSTEM_DIALOGS","")
      p.SendBroadcastIntent(i)
    End If
End Sub

with this added to the manifest

B4X:
AddActivityText(Main, <intent-filter>
   <action android:name="android.intent.ACTION_CLOSE_SYSTEM_DIALOGS" />
</intent-filter>)
 
Last edited:
Top