Skip to content
Browse files

Stop any service that get started after a successful broadcast intent…

… has been received
  • Loading branch information...
1 parent d37400b commit 56c536f42ecedbcbbea3e8bf9501c8b07176d444 @eyedol eyedol committed
View
4 Core/src/com/ushahidi/android/app/net/CheckinHttpClient.java
@@ -192,8 +192,8 @@ public boolean PostFileUpload(String URL, HashMap<String, String> params)
InputStream serverInput = respEntity.getContent();
if(serverInput !=null) {
//TODO:: get the status confirmation code to work
- int status = ApiUtils
- .extractPayloadJSON(GetText(serverInput));
+ //int status = ApiUtils
+ //.extractPayloadJSON(GetText(serverInput));
return true;
}
View
1 Core/src/com/ushahidi/android/app/net/MainHttpClient.java
@@ -43,7 +43,6 @@
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.params.ConnManagerPNames;
import org.apache.http.conn.params.ConnPerRouteBean;
import org.apache.http.conn.scheme.PlainSocketFactory;
View
1 Core/src/com/ushahidi/android/app/ui/phone/AddCheckinActivity.java
@@ -645,6 +645,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position,
public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 3);
+ stopService(uploadCheckins);
try {
unregisterReceiver(uploadBroadcastReceiver);
} catch (IllegalArgumentException e) {
View
1 Core/src/com/ushahidi/android/app/ui/phone/AddCommentActivity.java
@@ -238,6 +238,7 @@ protected boolean onSaveChanges() {
public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 3);
+ stopService(uploadComment);
try {
unregisterReceiver(uploadBroadcastReceiver);
} catch (IllegalArgumentException e) {
View
3 Core/src/com/ushahidi/android/app/ui/phone/ListReportCommentActivity.java
@@ -154,6 +154,7 @@ public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 4);
+ stopService(fetchReportComments);
view.dialog.cancel();
if (status == 4) {
toastLong(R.string.internet_connection);
@@ -163,8 +164,6 @@ public void onReceive(Context context, Intent intent) {
toastLong(R.string.could_not_fetch_comment);
} else if (status == 0) {
log("successfully fetched comments");
- // refreshCheckinList();
- // showUsers();
}
}
View
1 Core/src/com/ushahidi/android/app/ui/phone/ViewCheckinActivity.java
@@ -243,6 +243,7 @@ public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 4);
+ stopService(fetchCheckinComments);
if (status == 4) {
toastLong(R.string.internet_connection);
} else if (status == 110) {
View
1 Core/src/com/ushahidi/android/app/ui/phone/ViewReportActivity.java
@@ -304,6 +304,7 @@ public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 4);
+ stopService(fetchReportComments);
view.dialog.cancel();
if (status == 4) {
toastLong(R.string.internet_connection);
View
11 Core/src/com/ushahidi/android/app/ui/phone/ViewReportPhotoActivity.java
@@ -33,14 +33,12 @@
import android.widget.ImageSwitcher;
import android.widget.ViewSwitcher;
-import com.ushahidi.android.app.R;
import com.ushahidi.android.app.ImageManager;
+import com.ushahidi.android.app.R;
import com.ushahidi.android.app.activities.BaseViewActivity;
import com.ushahidi.android.app.entities.Photo;
import com.ushahidi.android.app.models.ListPhotoModel;
import com.ushahidi.android.app.util.ImageSwitchWorker;
-import com.ushahidi.android.app.util.ImageViewWorker;
-import com.ushahidi.android.app.util.Util;
import com.ushahidi.android.app.views.ReportPhotoView;
/**
@@ -111,8 +109,6 @@ private void goNext() {
position++;
if (!(position > (photos.size() - 1))) {
setImage(view.imageSwitcher);
- //view.imageSwitcher.setImageDrawable(photo.getImage(this, photos
- //.get(position).getPhoto()));
view.goNext();
int page = position;
this.setTitle(page + 1);
@@ -128,8 +124,6 @@ private void goPrevious() {
position--;
if ((position < (photos.size() - 1)) && (position != -1)) {
setImage(view.imageSwitcher);
- //view.imageSwitcher.setImageDrawable(photo.getImage(this, photos
- // .get(position).getPhoto()));
view.goPrevious();
int page = position;
@@ -157,9 +151,6 @@ private void initReport(int position) {
if (photos != null && photos.size() > 0) {
fileName = photos.get(position).getPhoto();
setImage(view.imageSwitcher);
- //view.imageSwitcher.setImageDrawable(photo.getImage(this, photos
- // .get(position).getPhoto()));
-
int page = position;
this.setTitle(page + 1);
}
View
3 Core/src/com/ushahidi/android/app/ui/tablet/ListCheckinFragment.java
@@ -461,8 +461,10 @@ public void onReceive(Context context, Intent intent) {
if (intent != null) {
int status = intent.getIntExtra("status", 4);
+ getActivity().stopService(fetchCheckins);
refreshState = false;
updateRefreshStatus();
+
if (status == 4) {
toastLong(R.string.internet_connection);
} else if (status == 110) {
@@ -479,6 +481,7 @@ public void onReceive(Context context, Intent intent) {
try {
getActivity().unregisterReceiver(fetchBroadcastReceiver);
} catch (IllegalArgumentException e) {
+ log("IllegalArgumentException", e);
}
}
};
View
2 Core/src/com/ushahidi/android/app/ui/tablet/ListMapFragment.java
@@ -264,8 +264,6 @@ public void run() {
public void refreshMapLists() {
adapter.refresh();
- // mListMapView.mListView.setAdapter(mListMapAdapter);
- // mListMapView.displayEmptyListText();
}
// Context Menu Stuff
View
1 Core/src/com/ushahidi/android/app/util/CheckinApiUtils.java
@@ -215,7 +215,6 @@ public boolean saveCheckins(Context context) {
List<Checkin> checkins = getCheckinsList(context);
if (checkins != null) {
-
return Database.mCheckin.addCheckins(checkins);
}
View
4 Core/src/com/ushahidi/android/app/util/PhotoUtils.java
@@ -323,11 +323,11 @@ public static Bitmap getRoundedCornerBitmap(Bitmap input,
private static int calculateInSampleSize(BitmapFactory.Options options,
int reqWidth, int reqHeight) {
- // raw height and weight of image
+ // raw height and weight of an image
final int width = options.outWidth;
final int height = options.outHeight;
int inSampleSize = 1;
- Log.i("XXX", String.format("ORIGINAL %dx%d", reqWidth, reqHeight));
+ new Util().log(String.format("ORIGINAL %dx%d", reqWidth, reqHeight));
if (height > reqHeight || width > reqWidth) {
if (width > height) {
inSampleSize = Math.round((float) height / (float) reqHeight);

0 comments on commit 56c536f

Please sign in to comment.
Something went wrong with that request. Please try again.