How to avoid Fatal signal 6 (SIGABRT) on android

匿名 (未验证) 提交于 2019-12-03 08:44:33

问题:

I'm using HttpURLConnection to get a web service, the server is in the same network but the responce can be delayed to 60000ms (bcs of some complicated causes i must set it to 60000ms), when i hit listview item to call the webservice and waiting for the responce and loose the wifi signal and continue clicking the list my app crash with no exception the error is A/libc(9052): Fatal signal 6 (SIGABRT) on android at 0x000001e5 (code=0), thread 9052 more clear: webservice call+ wifi lost+ clicks = Fatal signal 6 code=0 I'm trying to avoid this by:

  1. Blocking the UI or showing please wait but my please waite don't appear bcause there continious cliks
  2. Avoid UI cliks
    but no way!! please help, any propo and discussions are apreciated..

    public static boolean stopUserInteractions=false; private class GetXmlAndStopUI extends AsyncTask<List, Void, String> {  private final ProgressDialog dialog = new ProgressDialog(context);  @Override    protected void onPreExecute() {     this.dialog.setMessage("Please wait...");     this.dialog.setCancelable(false);     this.dialog.show();  } @Override protected String doInBackground(final List... items) {     runOnUiThread(new Runnable() {         @Override         public void run() {             webserviceCall(items[0]);         }     });   return "MSG"; } @Override protected void onPostExecute(String result) { stopUserInteractions=false;         if (this.dialog.isShowing()) {                   this.dialog.dismiss();           } } }    @Override public boolean dispatchTouchEvent(MotionEvent ev) {         if (stopUserInteractions) {                 Toast.makeText(context, "STOP!!!!", Toast.LENGTH_SHORT).show();                  return true;         } else {         return super.dispatchTouchEvent(ev); } } 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!