Store title that was submitted

This commit is contained in:
misaochan 2016-10-08 18:08:20 +13:00
parent d61b662f38
commit 43ef231035
2 changed files with 6 additions and 1 deletions

View file

@ -117,6 +117,10 @@ public class CategorizationFragment extends Fragment {
protected ArrayList<String> titleCatQuery() {
ArrayList<String> items = new ArrayList<String>();
SharedPreferences titleDesc = PreferenceManager.getDefaultSharedPreferences(getActivity());
//Retrieve the title that was saved when user tapped submit icon
String title = titleDesc.getString("Title", "");
Log.d(TAG, "Title: " + title);
return items;
}

View file

@ -52,12 +52,13 @@ public class SingleUploadFragment extends Fragment {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
//What happens when the 'submit' icon is tapped
case R.id.menu_upload_single:
String title = titleEdit.getText().toString();
String desc = descEdit.getText().toString();
//Save the values of these fields in short-lived cache so next time this fragment is loaded, we can access these
//Save the title/desc in short-lived cache so next time this fragment is loaded, we can access these
SharedPreferences titleDesc = PreferenceManager.getDefaultSharedPreferences(getActivity());
SharedPreferences.Editor editor = titleDesc.edit();
editor.putString("Title", title);