Converting folder name to string before applying it to folder info

> getText() returns Spannable which can contain text styling

Change-Id: Iacdf9da47b54b5cd290a355152383d75bf3e6836
This commit is contained in:
Sunny Goyal
2015-06-18 12:48:51 -07:00
parent 3ea5cd4311
commit 230eade4a3
+2 -3
View File
@@ -301,14 +301,13 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mFolderName.setHint(sHintText);
// Convert to a string here to ensure that no other state associated with the text field
// gets saved.
CharSequence newTitle = mFolderName.getText();
String newTitle = mFolderName.getText().toString();
mInfo.setTitle(newTitle);
LauncherModel.updateItemInDatabase(mLauncher, mInfo);
if (commit) {
sendCustomAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED,
String.format(getContext().getString(R.string.folder_renamed),
newTitle.toString()));
String.format(getContext().getString(R.string.folder_renamed), newTitle));
}
// In order to clear the focus from the text field, we set the focus on ourself. This
// ensures that every time the field is clicked, focus is gained, giving reliable behavior.