|
@@ -11,6 +11,7 @@ import android.text.TextUtils;
|
|
|
|
|
|
import com.alipay.sdk.app.PayTask;
|
|
import com.alipay.sdk.app.PayTask;
|
|
import com.hbc.hbc.R;
|
|
import com.hbc.hbc.R;
|
|
|
|
+import com.hbc.hbc.app.MainApplication;
|
|
import com.hbc.hbc.manager.ThreadPoolManager;
|
|
import com.hbc.hbc.manager.ThreadPoolManager;
|
|
|
|
|
|
import org.json.JSONException;
|
|
import org.json.JSONException;
|
|
@@ -43,22 +44,24 @@ public class AliPayUtil {
|
|
|
|
|
|
String callbackSuccess = (String) Utils.getCookieInfo(context, context.getString(R.string.userdata), "callbackSuccess", Utils.Type.String);
|
|
String callbackSuccess = (String) Utils.getCookieInfo(context, context.getString(R.string.userdata), "callbackSuccess", Utils.Type.String);
|
|
String callbackFail = (String) Utils.getCookieInfo(context, context.getString(R.string.userdata), "callbackFail", Utils.Type.String);
|
|
String callbackFail = (String) Utils.getCookieInfo(context, context.getString(R.string.userdata), "callbackFail", Utils.Type.String);
|
|
- Intent intent = new Intent();
|
|
|
|
- Bundle bundle = new Bundle();
|
|
|
|
- intent.setClass(context, context.getClass());
|
|
|
|
// 同步返回需要验证的信息
|
|
// 同步返回需要验证的信息
|
|
String resultInfo = payResult.getResult();
|
|
String resultInfo = payResult.getResult();
|
|
- if (TextUtils.equals(resultStatus, "9000")) {
|
|
|
|
- bundle.putString("Url", callbackSuccess);
|
|
|
|
- intent.putExtras(bundle);
|
|
|
|
- context.startActivity(intent);
|
|
|
|
- } else {
|
|
|
|
- if (!"".equals(callbackFail)) {
|
|
|
|
- bundle.putString("Url", callbackFail);
|
|
|
|
- intent.putExtras(bundle);
|
|
|
|
- context.startActivity(intent);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ if(!(context instanceof Activity)){
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
+ Activity activity = (Activity) context;
|
|
|
|
+ activity.runOnUiThread(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ if (TextUtils.equals(resultStatus, "9000")) {
|
|
|
|
+ WebUtils.doWebJs(MainApplication.MainApp.publicWebUrl, callbackSuccess + "()");
|
|
|
|
+ } else {
|
|
|
|
+ WebUtils.doWebJs(MainApplication.MainApp.publicWebUrl, callbackFail + "()");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|