Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "result": {
- "response": "OK",
- "message": "Authentication was successful.",
- "credencial": {
- "credencial": {
- "name": "hello world",
- "username": "a",
- "email": "a@gmail.com",
- "id": "58"
- }
- }
- }
- }
- protected void onPostExecute(JSONObject jsonObject) {
- if (jsonObject != null) {
- String jsondata, ddd;
- try {
- //JSONObject jsonObj = new JSONObject("result");
- jsondata = jsonObject.getString("result");
- Toast.makeText(getApplicationContext(), jsondata,
- Toast.LENGTH_LONG).show();
- pDialog.dismiss();
- Intent i = new Intent(LoginActivity.this, MainActivity.class);
- startActivity(i);
- finish();
- } catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- Toast.makeText(getApplicationContext(), "exception",
- Toast.LENGTH_SHORT).show();
- pDialog.dismiss();
- }
- }
- //}
- }
- protected void onPostExecute(JSONObject jsonObject) {
- if (jsonObject != null) {
- String jsondata, ddd;
- try {
- JSONObject jsonObj = jsonObject.getJsonbject("result");
- JSONObject credencialObj1 = jsonObj.getJsonObject("credencial");
- JSONObject credencialObj2 = credencialObj1.getJsonObject("credencial");
- String name = credencialObj2.getString("name");
- // so on
- } catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- Toast.makeText(getApplicationContext(), "exception",
- Toast.LENGTH_SHORT).show();
- pDialog.dismiss();
- }
- }
- }
- JSONObject jsonObj = new JSONObject(jsondata);
- String message = jsonObj.getString("message");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement