mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Change to getSharedPreferences to pass prefs between activities
This commit is contained in:
		
							parent
							
								
									ef3eda7d10
								
							
						
					
					
						commit
						ccb0c87b5f
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		|  | @ -33,12 +33,21 @@ class DirectUpload { | |||
|     } | ||||
| 
 | ||||
|     void storeSharedPrefs() { | ||||
|         SharedPreferences sharedPref = fragment.getActivity().getPreferences(Context.MODE_PRIVATE); | ||||
|         SharedPreferences sharedPref = fragment.getActivity().getSharedPreferences("Direct Upload",Context.MODE_PRIVATE); | ||||
|         SharedPreferences.Editor editor = sharedPref.edit(); | ||||
| 
 | ||||
|         editor.putString("Title", title); | ||||
|         editor.putString("Desc", desc); | ||||
|         editor.apply(); | ||||
| 
 | ||||
|         /** | ||||
|         //TODO remove this | ||||
|         sharedPref = fragment.getActivity().getSharedPreferences(Context.MODE_PRIVATE); | ||||
|         String imageTitle = sharedPref.getString("Title", ""); | ||||
|         String imageDesc = sharedPref.getString("Desc", ""); | ||||
| 
 | ||||
|         Timber.d("In DirectUpload, image title: " + imageTitle + " and image desc: " + imageDesc); | ||||
|          */ | ||||
|     } | ||||
| 
 | ||||
|     void initiateGalleryUpload() { | ||||
|  |  | |||
|  | @ -228,7 +228,7 @@ public  class      ShareActivity | |||
|             if (intent.hasExtra("isDirectUpload")) { | ||||
|                 Timber.d("This was initiated by a direct upload from Nearby"); | ||||
|                 //TODO: Shift this into title/desc screen after upload initiated | ||||
|                 SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); | ||||
|                 SharedPreferences sharedPref = this.getSharedPreferences("Direct Upload", Context.MODE_PRIVATE); | ||||
|                 String imageTitle = sharedPref.getString("Title", ""); | ||||
|                 String imageDesc = sharedPref.getString("Desc", ""); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan