Note that there are some explanatory texts on larger screens.

plurals
  1. POAsyncHttpClient not working
    primarykey
    data
    text
    <p>I have the following timer in onCreate():</p> <pre><code>new Timer().scheduleAtFixedRate(new TimerTask(){ public void run() { Log.i("EOH","timer"); updateMarkers(); }}, 0, 1000); </code></pre> <p>As you can see, it calls the function updateMarkers() every second.</p> <p>Here is updateMarkers():</p> <pre><code>private void updateMarkers(){ Log.i("EOH","updateMarkers()"); Drawable drawable = this.getResources().getDrawable(R.drawable.google_maps_marker); final MyItemizedOverlay itemizedoverlay = new MyItemizedOverlay(drawable,mapView); AsyncHttpClient myClient = new AsyncHttpClient(); final PersistentCookieStore myCookieStore = new PersistentCookieStore(context); myClient.setCookieStore(myCookieStore); RequestParams params = new RequestParams(); params.put("sw_lat", String.valueOf(centrePoint.getLat()-(Double.valueOf(mapView.getLatitudeSpan())/2.0))); params.put("sw_lng", String.valueOf(centrePoint.getLat()-(Double.valueOf(mapView.getLongitudeSpan())/2.0))); params.put("ne_lat", String.valueOf(centrePoint.getLat()+(Double.valueOf(mapView.getLatitudeSpan())/2.0))); params.put("ne_lng", String.valueOf(centrePoint.getLat()+(Double.valueOf(mapView.getLongitudeSpan())/2.0))); myClient.post("http://www.prestocab.com/ajax/getRanks.php", params, new AsyncHttpResponseHandler() { public void onStart() { thinger.setVisibility(View.VISIBLE); Log.i("EOH","onStart()"); } public void onSuccess(String response) { Log.i("EOH","xxx: "+response); thinger.setVisibility(View.INVISIBLE); try{ JSONArray arr=(JSONArray) new JSONTokener(response).nextValue(); Log.i("EOH","yyy: "+String.valueOf(arr.length())); }catch(JSONException e){ } } public void onFailure(Throwable e) { thinger.setVisibility(View.INVISIBLE); } public void onFinish() { } }); } </code></pre> <p>The problem I'm having is that <code>Log.i("EOH","onStart()");</code> never gets called! However <code>Log.i("EOH","updateMarkers()");</code> gets called...</p> <p>What am I doing wrong?</p> <p>Many thanks in advance,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload