wBB
wBB

Reputation: 851

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

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?

Upvotes: 2

Views: 822

Answers (1)

Dave Nottage
Dave Nottage

Reputation: 3602

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;

Upvotes: 7

Related Questions