Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isNetworkAvailable()) {
- AppFunction appFunction = new AppFunction(getApplicationContext(), this);
- AQuery mQuery = new AQuery(this);
- appFunction.Progress_Dialog("Loading...");
- mQuery.progress(AppFunction.mProgressDialog).ajax("http://www.rattil.org/MobileApp/JSON-APIS_v_2.0/TimeLine.php?UserID=9&LangId=1&StartDate=2013-08-21&EndDate=2013-09-20", JSONArray.class, new AjaxCallback<JSONArray>() {
- @Override
- public void callback(String url, JSONArray json, AjaxStatus status) {
- if (json != null) {
- for (int i = 0; i < json.length(); i++) {
- try {
- Log.e("Event text", json.getJSONObject(i).getString("EventText"));
- LayoutParams lparams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
- TextView tv = new TextView(LoginActivity.this);
- tv.setLayoutParams(lparams);
- tv.setText(Html.fromHtml(json.getJSONObject(i).getString("EventText")));
- rl.addView(tv);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- } else {
- Toast.makeText(getApplicationContext(), "Error in connection...", Toast.LENGTH_LONG).show();
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement