var github = new Async("https://api.github.com/users/john/repos") github.create(callback); function callback(){ github.createList("name"); github.createList("id"); }
var github = new Async("https://api.github.com/users/john/repos") github.create(); github.req.onload = function () { github.createList("name"); github.createList("id"); }
AutoCompleteTextView autoCompView = (AutoCompleteTextView) rootView.findViewById(R.id.searchLocation); autoCompView.setThreshold(3); autoCompView.setAdapter(new PlacesAutoCompleteAdapter(getActivity(), android.R.layout.simple_list_item_1)); autoCompView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { String PARAMETERS = resultList.get(arg2).getRef(); Log.e("ref string", PARAMETERS); new Async().execute("" + PARAMETERS); } });
var async = new Async(); async.complete = function(status, statusText, responseText, responseXML, obj) { if (status == 200) {
cd = new ConnectionDetector(getApplicationContext()); isInternetPresent = cd.isConnectingToInternet(); // check for Internet status if (isInternetPresent) { // Internet Connection is Present // make HTTP requests //showAlertDialog(AndroidDetectInternetConnectionActivity.this, "Internet Connection","You have internet connection", true); Intent myIntent = getIntent(); newurl=url+"="+myIntent.getSerializableExtra("catname").toString(); new Async().execute(); } else { // Internet connection is not present // Ask user to connect to Internet showAlertDialog(AndroidJSONParsingActivity.this, "No Internet Connection", "You don't have internet connection.", false); }
public void getAddress(LatLng latLng) throws IOException { URL url = new URL("https://maps.googleapis.com/maps/api/geocode/json?latlng="+latLng.latitude+","+latLng.longitude+"&key=AIza***********************"); Async async =new Async(); async.execute(url); //JSONArray response = async.jsonArray; //return response; }
Async a = new Async((Activity) getContext()); a.execute()