remove unused imports and fields; code formatting
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
package com.cradle.iitc_mobile.async;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import com.cradle.iitc_mobile.IITC_JSInterface;
|
||||
import com.cradle.iitc_mobile.IITC_Mobile;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
@ -24,12 +22,10 @@ import java.io.IOException;
|
||||
*/
|
||||
public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||
|
||||
private final IITC_JSInterface mJsInterface;
|
||||
private final Context mContext;
|
||||
private final IITC_Mobile mIitc;
|
||||
|
||||
public CheckHttpResponse(IITC_JSInterface jsInterface, Context c) {
|
||||
mContext = c;
|
||||
mJsInterface = jsInterface;
|
||||
public CheckHttpResponse(IITC_Mobile iitc) {
|
||||
mIitc = iitc;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,11 +39,10 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||
int code = response.getStatusLine().getStatusCode();
|
||||
if (code != HttpStatus.SC_OK) {
|
||||
Log.d("iitcm", "received error code: " + code);
|
||||
final IITC_Mobile iitc = (IITC_Mobile) mContext;
|
||||
iitc.runOnUiThread(new Runnable() {
|
||||
mIitc.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
iitc.setLoadingState(false);
|
||||
mIitc.setLoadingState(false);
|
||||
}
|
||||
});
|
||||
// TODO: remove when google login issue is fixed
|
||||
@ -68,7 +63,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||
protected void onPostExecute(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
Log.d("iitcm", "google auth error, redirecting to work-around page");
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mIitc);
|
||||
|
||||
// set title
|
||||
alertDialogBuilder.setTitle("LOGIN FAILED!");
|
||||
@ -86,8 +81,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.cancel();
|
||||
IITC_Mobile iitc_mobile = (IITC_Mobile) mContext;
|
||||
iitc_mobile.reloadIITC();
|
||||
mIitc.reloadIITC();
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user