2

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?

wBB
  • 821
  • 1
  • 18
  • 39

1 Answers1

7

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;
Dave Nottage
  • 3,411
  • 1
  • 20
  • 57