Skip to content

Commit

Permalink
Fix Search View translation
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jul 19, 2015
1 parent 1c1f81e commit e629e75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>

<meta-data
android:name="android.app.searchable"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.javiersantos.mlmanager.activities;

import android.app.Activity;
import android.app.SearchManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
Expand Down Expand Up @@ -334,6 +335,10 @@ public boolean onCreateOptionsMenu(Menu menu) {
searchItem = menu.findItem(R.id.action_search);
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
searchView.setOnQueryTextListener(this);

SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

return true;
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/xml/searchable.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/search_hint"
android:label="@string/app_name" />

0 comments on commit e629e75

Please # to comment.