title: Empty Activity each time user clicks on Suggestions
body: <p>I implemented a Searchable Activity within my Android App, and I give to the User the possibility to click straight on the suggestions...</p>
  
  <p>The problem is that each time you click on one suggestion, if you press back you come in a empty searchable activity. This does not provide a good user experience and I want to fix it.</p>
  
  <p>Here my code:</p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>@Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.option_menu, menu);
  
          SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView searchView = (SearchView) menu.findItem(R.id.search_item).getActionView();
  
          //Specify the searchable activity            
          searchView.setSearchableInfo(searchManager.getSearchableInfo
                  (new ComponentName(this, SearchableActivity.class)));
  
          searchView.setIconifiedByDefault(false);  // Do not iconify the widget; expand it by default
  
          return true;
      }
  </code></pre>
  
  <p><strong>Searchable Activity</strong></p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_searchable);
          handleIntent(getIntent(), false);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          Log.v("Activity", "onCreateOptionMenu");
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.option_menu, menu);
  
          SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView searchView = (SearchView) menu.findItem(R.id.search_item).getActionView();
  
          //Specify the searchable activity (this one)
         searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
  
          searchView.setSubmitButtonEnabled(true); //Submit research button
          searchView.setQueryRefinementEnabled(true); //Move the suggestion in the search bar
  
  
          searchView.setIconifiedByDefault(true);  // Do not iconify the widget; expand it by default
  
          return true;
      }
  
      @Override
      protected void onNewIntent(Intent intent) {
          Log.v("(onNewIntent", "im in NewIntent -Activity");
          // Because this activity has set launchMode="singleTop", the system calls this method
          // to deliver the intent if this activity is currently the foreground activity when
          // invoked again (when the user executes a search from this activity, we don't create
          // a new instance of this activity, so the system delivers the search intent here)
          handleIntent(intent, true);
      }
  
  
      private void handleIntent(Intent intent, boolean onNewIntent) {
          //Get the intent, verify the action and get the query
          if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
              String query = intent.getStringExtra(SearchManager.QUERY);
              //DO MY STUFF WITH THE QUERY
              Bundle arguments = new Bundle();
              arguments.putString(QUERY_FOR_BUNDLE, query);
  
              SearchableFragment searchableFragment = new SearchableFragment();
              searchableFragment.setArguments(arguments);
  
              getSupportFragmentManager().beginTransaction()
                      .replace(R.id.activity_searchable_container, searchableFragment)
                      .commit();
  
              Toast.makeText(getApplicationContext(), "(onCreate)Searching by: " + query, Toast.LENGTH_SHORT).show();
  
          } else if (Intent.ACTION_VIEW.equals(intent.getAction())) {
              Uri uri = intent.getData();
              int id = Integer.parseInt(uri.getLastPathSegment());
  
              Intent intentDetailActivity = new Intent (getApplicationContext(), DetailActivity.class);
              intentDetailActivity.putExtra("ID", id);
  
              Toast.makeText(getApplicationContext(), "(onCreate) Suggestion ID: " + id, Toast.LENGTH_SHORT).show();
              Toast.makeText(getApplicationContext(), "(onCreate) Suggestion URI: " + uri, Toast.LENGTH_LONG).show();
  
              startActivity(intentDetailActivity);
            }
      }
  </code></pre>
  
  <p><strong>searchable.xml</strong></p>
  
  <pre><code>&lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
  
      android:hint="HINT"
      android:label="@string/app_name"
  
      android:includeInGlobalSearch="true"
      android:searchSuggestAuthority="com.test.tcook.app"
      android:searchSuggestIntentAction="android.intent.action.VIEW"
      android:searchSuggestIntentData="intentTest"
      android:searchSuggestThreshold="1"
      android:searchSuggestSelection=" ?"
      android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"
      /&gt;
  </code></pre>