Android Question Intent 'android.settings' in different versions of Android

henry1311

Member
Licensed User
Longtime User
Hello to all.

The following code:
B4X:
Dim xAction As Intent
Dim s1 As String
s1 = "android.settings.WIRELESS_SETTINGS"
xAction.Initialize (s1, "")
StartActivity (xAction)

in Android 2.x directly displays only the configuration of the network, while in vers. 3.x and 4.0 and 4.1 displays all options 'settings'.

Likewise, the code
B4X:
Dim xAction As Intent
Dim s1 As String
s1 = "android.settings.WIFI_SETTINGS"
xAction.Initialize (s1, "")
StartActivity (xAction)

in Android 2.x directly displays only the configuration of the wifi while in vers. 3.x and 4.0 and 4.1 displays all options 'settings'.

Is there a way to view only one part even in versions 3 and 4? (Eg: wireless, network, bluetooth, audio, display, etc.).

Hello and thank you
Enrico
 

NJDude

Expert
Licensed User
Longtime User
You could start the corresponding activities directly, this works on any version of Android:

Display WiFi settings screen:
B4X:
Dim i As Intent

i.Initialize("", "")

i.SetComponent("com.android.settings/.wifi.WifiSettings")

StartActivity(i)

Display Bluetooth settings screen:
B4X:
Dim i As Intent

i.Initialize("", "")

i.SetComponent("com.android.settings/.bluetooth.BluetoothSettings")

StartActivity(i)

Show Display settings screen:
B4X:
Dim i As Intent

i.Initialize("", "")

i.SetComponent("com.android.settings/.DisplaySettings")

StartActivity(i)

Time settings
B4X:
Dim i As Intent

i.Initialize("", "")

i.SetComponent("com.android.settings/.Settings$DateTimeSettingsActivity")

StartActivity(i)

etc. etc.
 
Last edited:
Upvote 0

henry1311

Member
Licensed User
Longtime User
thanks for the reply NjDude.
But as you say you always show all the options in 'Settings'.
That set from i.Setcomponent is selected, but I'm not supposed to see and change the other!
Thank you all.
hello
enrico
 
Upvote 0

Ian Garton

Member
Licensed User
Longtime User
Any ideas on how to display the Date/Time Settings activity?
The intent format Settings$DateTimeSettingsActivity doesn't seem to work.

B4X:
Dim i As Intent
i.Initialize("", "")                
i.SetComponent("com.android.settings/Settings$DateTimeSettingsActivity")
StartActivity(i)
 
Upvote 0

realblue

Member
Licensed User
Longtime User
Hi Erel,

How can I activate Ethernet settings?

B4X:
i.SetComponent("com.android.settings/.ethernet.EthernetSettings") ' is not working!
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
hi,

From where do you guys know that all? I've been searching for hours and didn't find the intent for the security settings. where to find the b4a compatible intents?

Best regards

Edit: I made it work :)
(i.SetComponent("com.android.settings/com.android.settings.SecuritySettings"))

but i am still unsure about why it works like this.... can someone explain it please?
 
Last edited:
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
Hey NJ,
Thanks for the answer. I had it already ;)

But for future questions i'd like to know where to find that things. From where do you know that?

Best regards
 
Upvote 0

chrjak

Active Member
Licensed User
Longtime User
so you can open the app or whatever and then you see the intent in the logcat? wow. thats easier than i thought....

or what do you mean with unfiltered? Is there something to change in b4a logcat?
 
Upvote 0

jai76

Member
Licensed User
Longtime User
Hi all,
Good day,

How can i intent directly to the flight mode setting?
Where I can enable and disable the mode manually.

Thanks in advance..
 
Upvote 0

jai76

Member
Licensed User
Longtime User
B4X:
Dim i As Intent
i.Initialize("android.settings.AIRPLANE_MODE_SETTINGS", "")
StartActivity(i)
solved, I figure it out..
 
Upvote 0
Top