mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Store title that was submitted
This commit is contained in:
parent
d61b662f38
commit
43ef231035
2 changed files with 6 additions and 1 deletions
|
|
@ -117,6 +117,10 @@ public class CategorizationFragment extends Fragment {
|
||||||
protected ArrayList<String> titleCatQuery() {
|
protected ArrayList<String> titleCatQuery() {
|
||||||
ArrayList<String> items = new ArrayList<String>();
|
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;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,13 @@ public class SingleUploadFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
//What happens when the 'submit' icon is tapped
|
||||||
case R.id.menu_upload_single:
|
case R.id.menu_upload_single:
|
||||||
|
|
||||||
String title = titleEdit.getText().toString();
|
String title = titleEdit.getText().toString();
|
||||||
String desc = descEdit.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 titleDesc = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
SharedPreferences.Editor editor = titleDesc.edit();
|
SharedPreferences.Editor editor = titleDesc.edit();
|
||||||
editor.putString("Title", title);
|
editor.putString("Title", title);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue