Question: How can I open the location settings from android via Qt? 

I have already tried this and I can open the settings successfully, but not the location settings: 

```
QAndroidJniObject intent("android/content/Intent","()V");
    if ( intent.isValid() )
    {
        QAndroidJniObject param1 = QAndroidJniObject::fromString("com.android.settings");
        QAndroidJniObject param2 = QAndroidJniObject::fromString("com.android.settings.Settings");

        if ( param1.isValid() && param2.isValid() )
        {
            intent.callObjectMethod("setClassName","(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;",param1.object<jobject>(),param2.object<jobject>());

            activity.callObjectMethod("startActivity","(Landroid/content/Intent;)V",intent.object<jobject>());
        }
    }

```

I even have changed the param2 to "android.settings.LOCATION\_SOURCE\_SETTINGS" as it is written on the Android Developer page - but without any success. 

Does anybody know how to do that?
Thanks!

Answer: 
The best I could work out for stopping all buttons responding to the space-bar is this:

**NB: It is a bit of a hack**:

Set your form's `KeyPreview` property to `true`.

Then add this code to the form's `KeyPress` event:

```
private void Form1_KeyPress(object sender, KeyPressEventArgs e) 
{
   if (this.ActiveControl is Button
   && e.KeyChar == (char)Keys.Space) 
   {
      var button = this.ActiveControl;
      button.Enabled = false;
      Application.DoEvents();
      button.Enabled = true;
      button.Focus();
   }
}

```

And to stop a control from getting focus when tabbing, simply set the button's `TabStop` property to false.
Looks like you have troubles applying my previous answer. Here is another way using the same idea:

Add a new code file to your project and put the following code inside (make sure to replace `YourNamespace` with yours!)

```
using System;
using System.Reflection;
using System.Windows.Forms;

namespace YourNamespace
{
    public static class Utils
    {
        private static readonly Action<Control, ControlStyles, bool> SetStyle =
            (Action<Control, ControlStyles, bool>)Delegate.CreateDelegate(typeof(Action<Control, ControlStyles, bool>),
            typeof(Control).GetMethod("SetStyle", BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(ControlStyles), typeof(bool) }, null));
        public static void DisableSelect(this Control target)
        {
            SetStyle(target, ControlStyles.Selectable, false);
        }
    }
} 

```

Then use it inside your Form Load event for each button you need to have that behavior. 

For instance, if your form contains 2 buttons called `btnPrev` and `btnNext`, include the following lines in your form load event

```
btnPrev.DisableSelect();
btnNext.DisableSelect();

```