jSoup.connect(url).get()
在我的Android应用中出现错误异常。 URL在浏览器上正常工作或使用'HTTPCLIENT'命中URL但当我通过jsoup访问它时它会在android中引发异常。
public class PracticeDetailsRequest extends AsyncTask<String, String, ArrayList<JSONObject>>{
public LoginActivity activity;
PracticeDetailsRequest(LoginActivity context)
{
activity = context;
}
@Override
protected ArrayList<JSONObject> doInBackground(String... value) {
string url= "http://cmdlhravn01/ChargeCapture/Authentication/ChargeCaptureLogin?username=bilbl786&password=2ac9da7dc0243c0083eb70898e549b63&practiceid=1&userid=78&locationid=2&DBName=MUII_CureMD&DBServerName=cmdlhrnavqa01";
jSoup.connect(url).get();
}
}
例外:
05-26 17:31:05.589: E/ActivityThread(22045): Activity com.example.avalon.LoginActivity has leaked IntentReceiver org.apache.cordova.CordovaWebView$1@41e6bdd0 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-26 17:31:05.589: E/ActivityThread(22045): android.app.IntentReceiverLeaked: Activity com.example.avalon.LoginActivity has leaked IntentReceiver org.apache.cordova.CordovaWebView$1@41e6bdd0 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-26 17:31:05.589: E/ActivityThread(22045): at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:805)
答案 0 :(得分:1)
您需要unregisterReceiver()
方法中的onPause()
。然后,您可以使用onRestart()
方法重新注册它。
更多信息: Android: Leaked IntentReceiver exception is being thrown even though I call unregisterReceiver