Webview with asynctask on Android

Don’t use AsyncTask, as you are not in charge of loading the webview. If you want to show a progress dialog, here is how to do it. private ProgressDialog dialog = new ProgressDialog(WebActivity.this); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webview); webView = (WebView) findViewById(R.id.webView1); Bundle extras = getIntent().getExtras(); String url=extras.getString(“adres”); webView.setWebViewClient(new WebViewClient() { @Override … Read more

Android: How to return async JSONObject from method using Volley?

For your comment I think that async is provided by Volley automatically. So i need to know how to get JSON data into the first snippet IMO, instead of your first snippet, you can try the following way (of course, you can replace JSONArray request by JSONObject request): VolleyResponseListener listener = new VolleyResponseListener() { @Override … Read more

android design considerations: AsyncTask vs Service (IntentService?)

In my opinion this is the most tricky/hard part of a mainstream/average Android development. For instance on BlackBerry this is IN TIMES easier. Definitely you need to use a Service. AsyncTask does not suit, because it is tightly “bound” to your Activity via a Context handle (otherwise you would not be able to update UI … Read more

Properly Using AsyncTask get()

When you are using get, using Async Task doesn’t make any sense. Because get() will block the UI Thread, Thats why are facing 3 to 5 secs of blank screen as you have mentioned above. Don’t use get() instead use AsyncTask with Call Back check this AsyncTask with callback interface