Using context.getString for getting formatted strings, as it works better with different locales

Change-Id: I9639bb11197e656c5cdd3a4d63f913edcc0987cb
This commit is contained in:
Sunny Goyal
2015-09-02 15:06:12 -07:00
parent 9e0702f4af
commit f4f89ef608
6 changed files with 8 additions and 12 deletions

View File

@@ -414,11 +414,10 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
*/
public void setLastSearchQuery(String query) {
Resources res = mLauncher.getResources();
String formatStr = res.getString(R.string.all_apps_no_search_results);
mLastSearchQuery = query;
mEmptySearchMessage = String.format(formatStr, query);
mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query);
if (mMarketAppName != null) {
mMarketSearchMessage = String.format(res.getString(R.string.all_apps_search_market_message),
mMarketSearchMessage = res.getString(R.string.all_apps_search_market_message,
mMarketAppName);
mMarketSearchIntent = createMarketSearchIntent(query);
}