开发者

Getting the Bluetooth settings Connect & pair screen using intent?

开发者 https://www.devze.com 2023-03-16 10:14 出处:网络
I want to navigate directly to the bluetooth settings Connect & pair screen on a button click now I can navigate till the wireless settings..

I want to navigate directly to the bluetooth settings Connect & pair screen on a button click now I can navigate till the wireless settings..

My code is as开发者_如何学编程 follows:

Intent i=new Intent();
i.setClassName("com.android.settings","com.android.settings.WirelessSettings");
startActivity(i);


It's pretty simple, try this:

Intent settingsIntent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivity(settingsIntent);


Use the follwoing:

    Intent settings_intent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
    startActivityForResult(settings_intent, 0);

This way you will open Bluetooth settings page and later return back to your activity that started the Intent.

0

精彩评论

暂无评论...
验证码 换一张
取 消