How to call the native window of Bluetooth settings on Android in Delphi?

点点圈 提交于 2019-12-06 11:00:44

问题


I've seen an app where its Bluetooth settings calls the native window of Android Bluetooth settings. When the user press Android Back button, it returns to the app. How does this call the native Bluetooth settings window in Delphi?


回答1:


As per: How do I open the Bluetooth Settings Activity programmatically?

uses
  Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.Provider, Androidapi.Helpers;

procedure TForm1.Button1Click(Sender: TObject);
var
  LIntent: JIntent;
begin
  LIntent := TJIntent.Create;
  LIntent.setComponent(TJComponentName.JavaClass.init(StringToJString('com.android.settings'), StringToJString('com.android.settings.bluetooth.BluetoothSettings')));
  TAndroidHelper.Context.startActivity(LIntent);
end;


来源:https://stackoverflow.com/questions/49837861/how-to-call-the-native-window-of-bluetooth-settings-on-android-in-delphi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!