I use HttpURLConnection to get a web service, the server is on the same network, but the response can be delayed up to 60,000 ms (bcs of some difficult reasons I have to set it to 60,000 ms) when I click on the list item to call the web service and wait answer and lose the Wi-Fi signal and continue to click on the list of my application crashes, without exception, error A/libc(9052): Fatal signal 6 (SIGABRT) on android at 0x000001e5 (code=0), thread 9052 more clearly: webservice call+ wifi lost+ clicks = Fatal signal 6 code=0 I try to avoid this:
- UI blocking or showing, please wait, but mine please waite do not appear bcause there are continuous clicks
Avoid UI Clicks
but no way! please help, any propos and discussions will be appreciated.
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); } }
android multithreading
Smile2Life
source share