我試圖調用顯示WiFi,聲音和藍牙但不是工作的設置: 我將把我的代碼放在這裏,還有logcat我希望這個設置在按鈕點擊事件上,並且只顯示選定的圖標 如果有其他方式使用此Android意圖不適用於WiFi,聲音,藍牙?
我想使用像看到這裏
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wifi);
Button wifi =(Button)findViewById(R.id.wifi);
wifi.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(android.provider.Settings.AUTHORITY);
intent.putExtra(Settings.EXTRA_AUTHORITIES, new String[] {
android.provider.Settings.ACTION_BLUETOOTH_SETTINGS
});
intent.putExtra(Settings.EXTRA_AUTHORITIES, new String[] {
android.provider.Settings.ACTION_WIFI_SETTINGS
});
startActivity(intent);
}
});
}
圖像logcat的
12-13 10:36:04.229: E/AndroidRuntime(1167): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=authorities cat=[android.settings.BLUETOOTH_SETTINGS,android.settings.SOUND_SETTINGS,android.settings.WIRELESS_SETTINGS] }
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.app.Activity.startActivityForResult(Activity.java:3217)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.app.Activity.startActivity(Activity.java:3324)
12-13 10:36:04.229: E/AndroidRuntime(1167): at com.example.settings.WifiActivity$1.onClick(WifiActivity.java:30)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.view.View.performClick(View.java:3511)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.view.View$PerformClick.run(View.java:14109)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.os.Handler.handleCallback(Handler.java:605)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.os.Handler.dispatchMessage(Handler.java:92)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.os.Looper.loop(Looper.java:137)
12-13 10:36:04.229: E/AndroidRuntime(1167): at android.app.ActivityThread.main(ActivityThread.java:4424)
12-13 10:36:04.229: E/AndroidRuntime(1167): at java.lang.reflect.Method.invokeNative(Native Method)
12-13 10:36:04.229: E/AndroidRuntime(1167): at java.lang.reflect.Method.invoke(Method.java:511)
12-13 10:36:04.229: E/AndroidRuntime(1167): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-13 10:36:04.229: E/AndroidRuntime(1167): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-13 10:36:04.229: E/AndroidRuntime(1167): at dalvik.system.NativeStart.main(Native Method)
我想打開後buttonclick從我的應用程序的設置被重定向到設置,並只顯示WiFi,藍牙和聲音設置等設置不希望顯示不適用於此 – Mahesh
什麼是寫在logcat? –