From 22d3990273a1cb5e61360ac42d1d4e6156d762ed Mon Sep 17 00:00:00 2001 From: Stefan Wysocki Date: Tue, 4 Mar 2014 11:27:55 +0100 Subject: [PATCH] Set ActionMode title to the number of selected files After change of orientation ActionMode is recreated without previously set title. It needs to be updated in onCreateActionMode callback. Change-Id: If5f36e8ad6d1b5cf04ed242611fd037969d73517 --- .../src/com/android/documentsui/DirectoryFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index b2b2bd85f783b..9069a55404ee8 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -436,6 +436,8 @@ public class DirectoryFragment extends Fragment { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { mode.getMenuInflater().inflate(R.menu.mode_directory, menu); + mode.setTitle(getResources() + .getString(R.string.mode_selected_count, mCurrentView.getCheckedItemCount())); return true; }