@Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.header_left:
       finish();
       break;
     case R.id.header_right_2:
       mInputManager.hideSoftInputFromWindow(mAutoCompleteTextView.getWindowToken(), 0);
       String url = mAutoCompleteTextView.getText().toString().trim();
       String title = mTitle.getText().toString().trim();
       if (!Patterns.WEB_URL.matcher(url).matches()) {
         Toast.makeText(this, R.string.url_not_true, Toast.LENGTH_SHORT).show();
         return;
       }
       url = URLUtil.guessUrl(url);
       if (TextUtils.isEmpty(title)) {
         title = makeTitleByUrl(url);
       }
       NavigationInfo info = new NavigationInfo();
       info.setTitle(title);
       info.setUrl(url);
       NavigationInfoParser.getInstance(this).addNavigationInfo(info);
       Intent intent = new Intent(this, BrowserActivity.class);
       intent.setAction(Intent.ACTION_MAIN);
       intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
       startActivity(intent);
       overridePendingTransition(R.anim.activity_slide_do_nothing, R.anim.slide_down_out);
       break;
     case R.id.clear_address_button:
       mAutoCompleteTextView.setText("");
       break;
     case R.id.clear_title_button:
       mTitle.setText("");
       break;
     default:
       break;
   }
 }
 @Override
 protected FilterResults performFiltering(CharSequence constraint) {
   FilterResults results = new FilterResults();
   if (TextUtils.isEmpty(constraint)) {
     results.count = 0;
     return results;
   }
   List<NavigationInfo> infos =
       NavigationInfoParser.getInstance(getApplicationContext())
           .searchNavigationInfos(
               constraint.toString(),
               new NavigationInfoFilter() {
                 @Override
                 public boolean onFilter(NavigationInfo info) {
                   return info.isAdded();
                 }
               });
   if (infos.size() > 3) {
     infos = infos.subList(0, 3);
   }
   results.count = infos.size();
   results.values = infos;
   return results;
 }