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?
Asked
Active
Viewed 702 times
1 Answers
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
-
Perfect! Thanks – wBB Apr 15 '18 at 20:10
-
This doesn't seem to be working for me. Is there any user permissions that I need to set for this? – Shaun Roselt Apr 30 '18 at 22:06
-
Works for me on my Nexus 5X running Android 8.1, starting from a blank project. What version of Android do you have, and are there any errors? – Dave Nottage Apr 30 '18 at 23:12