title: Any fixes for crash because of combination of WRITE_SETTINGS and SEARCH_LONG_PRESS?
body: <p>I'm trying to create an app that will change a setting when the user holds the search button. It seems that the combination of the <code>WRITE_SETTINGS</code> permission and the fact that the activity is launched from another application using the long press makes the parent task crash. For example, if I'm looking at Google Maps and hold the search button, the SearchButtonPopup does not appear and Google Maps crashes.</p>
  
  <p>I tried taking the Theme.Dialog out, but it didn't make any difference. Removing the permission makes it robust again, no crashes, but I need the permission! Any fixes or workarounds?</p>
  
  <p>These are my manifest and java files:</p>
  
  <h2>AndroidManifest.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.stathissideris.searchbuttonpopup" android:versionCode="1"
      android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="3" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt;
  
      &lt;application android:icon="@drawable/logo" android:label="@string/app_name"
          android:debuggable="true" android:permission="android.permission.WRITE_SETTINGS"&gt;
          &lt;activity android:name=".SearchButton" android:theme="@android:style/Theme.Dialog"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.SEARCH_LONG_PRESS" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <h2>SearchButton.java</h2>
  
  <pre><code>package org.stathissideris.searchbuttonpopup;
  
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  
  public class SearchButton extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Log.d("SearchButtonPopup", "search held");
  
      }
  }
  </code></pre>