use apply() with all SharedPreferences
if the code does not check the result of commit() it should use apply() since that runs in the background.
This commit is contained in:
		
							parent
							
								
									d8e83c7c9c
								
							
						
					
					
						commit
						15181d47f5
					
				@ -331,7 +331,7 @@ public class SwapService extends Service {
 | 
			
		||||
    // ==========================================
 | 
			
		||||
 | 
			
		||||
    private void persistAppsToSwap() {
 | 
			
		||||
        persistence().edit().putString(KEY_APPS_TO_SWAP, serializePackages(appsToSwap)).commit();
 | 
			
		||||
        persistence().edit().putString(KEY_APPS_TO_SWAP, serializePackages(appsToSwap)).apply();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -398,7 +398,7 @@ public class SwapService extends Service {
 | 
			
		||||
            persistence().edit()
 | 
			
		||||
                    .putBoolean(KEY_BLUETOOTH_ENABLED, bluetoothSwap.isConnected())
 | 
			
		||||
                    .putBoolean(KEY_WIFI_ENABLED, wifiSwap.isConnected())
 | 
			
		||||
                    .commit();
 | 
			
		||||
                    .apply();
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user