tags:

views:

611

answers:

2

Hi, Normally Iam getting Wi-Fi setting screen on the emulator by clicking on the settings->Wireless controls->wifi settings.I need to directly go to the Wi-Fi settings screen from my program when pressing on the Wi-Fi button which I had created.Contacts,Call Logs we can handle by using Intent.setData(android.provider.contacts...........).Is it any way to connect settings sub menus/menu from android program.Please give me advise or sample code on this.

Regards, Rajendar

+2  A: 

Look at android.provider.Settings for a series of Intent actions you can use to launch various settings screens (e.g., ACTION_WIFI_SETTINGS).

CommonsWare
to be more specific,android.app.activity.startActivity(new **android.content.Intent.Intent(android.provider.settings.Settings.ACTION_WIFI_SETTINGS));**or with proper *using*,**startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));**
Alex Cohn
A: 

Hi,

I used

1) Intent i = new Intent(); 2) i.setAction(Intent.ACTION_VIEW); 3) i.setData(android.provider.Settings.ACTION_WIRELESS_SETTINGS); 4) startActivity(i);

In the 4 th line error shows me

The method setData(Uri) in the type Intent is not application for arguments (string).

For example to call images of the mobile we use

intent.setData(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);

Here exactly we take argument as a Uri for the method but for settings there is no way to set Uri. So please give me any Idea on this? I am new to android

Rajendar

rajendar
it is not ACTION_VIEW, it's a special case, which you choose directly for your Intention: **startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));**
Alex Cohn