mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-11-04 08:43:52 +01:00 
			
		
		
		
	Change to getSharedPreferences to pass prefs between activities
This commit is contained in:
		
							parent
							
								
									13a73fdcac
								
							
						
					
					
						commit
						fba7628f3c
					
				
					 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() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue