Android Question can add inside B4XPreferencesDialog a line option to execute sub

scsjc

Well-Known Member
Licensed User
Longtime User
I want put a line inside B4XPreferencesDialog to call a sub.... same that:

B4X:
Dim i As Intent
i.Initialize("com.android.settings.TTS_SETTINGS", "")
StartActivity(i)

Thanks :)
 

Mahares

Expert
Licensed User
Longtime User
I want put a line inside B4XPreferencesDialog to call a sub.... same that:
Use perhaps the shortoptions: Try it it seems to work for me:
B4X:
prefdialog.AddShortOptionsItem("Options","Country" , Array ("Australia", "Spain"," England", "France", "United States of America"))
    Dim Data As Map = CreateMap("Options":"")  'of course you can have other items in the map
    Dim sf As Object = prefdialog.ShowDialog(Data, "OK", "CANCEL")
    Wait For (sf) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        If Data.Get("Options").As(String).Contains("Spain") Then
            Log("Best women football Team in the world")
            Dim i As Intent
            i.Initialize("com.android.settings.TTS_SETTINGS", "")
            StartActivity(i)
        End If
    End If
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Use perhaps the shortoptions: Try it it seems to work for me:
B4X:
prefdialog.AddShortOptionsItem("Options","Country" , Array ("Australia", "Spain"," England", "France", "United States of America"))
    Dim Data As Map = CreateMap("Options":"")  'of course you can have other items in the map
    Dim sf As Object = prefdialog.ShowDialog(Data, "OK", "CANCEL")
    Wait For (sf) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        If Data.Get("Options").As(String).Contains("Spain") Then
            Log("Best women football Team in the world")
            Dim i As Intent
            i.Initialize("com.android.settings.TTS_SETTINGS", "")
            StartActivity(i)
        End If
    End If
Hi friend, thanks for your reply :)
mmm i looking something like a static menu line......
 
Upvote 0
Top