Ver código fonte

User code now read.

seavenois 9 anos atrás
pai
commit
72f386f32d

+ 9 - 1
app/src/main/java/com/ivalentin/margolariak/MainActivity.java

@@ -626,12 +626,20 @@ public class MainActivity extends Activity {
 	/**
 	 * Performs a full sync against the remote database.
 	 */
-	public void sync() {
+	private void sync() {
 		ProgressBar pbSync = (ProgressBar) findViewById(R.id.pb_sync);
 		ImageView ivSync = (ImageView) findViewById(R.id.iv_logo);
 		new Sync(this, pbSync, ivSync).execute();
 	}
 
+	/**
+	 * Asks the activity to performa a sync.
+	 * Intended to be called from any screen.
+	 */
+	public void bgSync(){
+		new Sync(this).execute();
+	}
+
 	/**
 	 * Perform an initial sync before the app can be used.
 	 * A dialog will block the UI.

+ 1 - 1
app/src/main/java/com/ivalentin/margolariak/PostComment.java

@@ -174,7 +174,7 @@ class PostComment extends AsyncTask<String, String, Integer> {
             //TODO: Update counter
 
 			//Perform a sync
-			((MainActivity) context).sync();
+			((MainActivity) context).bgSync();
 
 
             //Insert comment in list