title: display result of json data in textview of android
body: <p>I am having one problem while displaying data in android app.This is my php.I have edited now to shorten the code.
      
  
  <pre><code>if($imei_no!="" &amp;&amp; $app_auid!="")
  {
          //chk query
          $chk_query=$db1-&gt;query("select * from user where imei_number='$imei_no'");
          $chk_cnt=$chk_query-&gt;rowCount();
          if($chk_cnt&gt;0)
          {
              $search_qry=$db1-&gt;query("select * from candidate_reception cr,candidate_counseling cc ,candidate_admission ca where cr.candidate_id=cc.candidate_id and cr.candidate_id=ca.candidate_id and cr.auid=ca.auid and cr.counseling_id=cc.counseling_id and cr.auid='$app_auid'");
              $ser_count=$search_qry-&gt;rowCount();
              if($ser_count&gt;0)
              {
                  $stud_row=$search_qry-&gt;fetch(PDO::FETCH_OBJ);
  
                  $candidate_id=$stud_row-&gt;candidate_id;
                  $auid = $stud_row-&gt;auid;
                  $usn_no = $stud_row-&gt;usn_no;
                  $sx = $stud_row-&gt;candidate_sex
  
  
                  //image path    
                    if($inst_id==1){ $img_path = "1"; }
                    if($inst_id==2){ $img_path = "2"; }
  
                  $result=array();    
                  array_push($result, array('name' =&gt; $candidate_name,'img_path'=&gt;$img_path));
  
              echo json_encode(array("can_data"=&gt;$result));
              echo "Success"          
              }
              else
              {
                  echo "Auid not Found.";
              }       
          }
          else
          {
              echo "Invalid IMEI Number.!!!";
          }
  }
  ?&gt;
  </code></pre>
  
  <p>and this is my java code:</p>
  
  <pre><code>  private static final String LOGIN_URL = "http://xxx.xxx.x.x/mobile_app/data_push.php";
      private EditText editTextUserName;
      private Button buttonLogin;
  
      TelephonyManager tel;
      TextView imei;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_imei__val);
  
          editTextUserName = (EditText) findViewById(R.id.editTextAUID);
          buttonLogin = (Button) findViewById(R.id.btn);
          buttonLogin.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  login();
              }
          });
  
          tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
          imei = (TextView) findViewById(R.id.textView2);
          imei.setText(tel.getDeviceId().toString());
  
      }
  
      private void login(){
          String username = editTextUserName.getText().toString().trim();
          String imei_no = imei.getText().toString().trim();
          userLogin(username,imei_no);
      }
  
      private void userLogin(final String username,final String imei_no){
          class UserLoginClass extends AsyncTask&lt;String,Void,String&gt; {
              ProgressDialog loading;
              @Override
              protected void onPreExecute() {
                  super.onPreExecute();
                  loading = ProgressDialog.show(IMEI_Val.this,"Please Wait",null,true,true);
              }
  
              @Override
              protected void onPostExecute(String s) {
                  super.onPostExecute(s);
                  loading.dismiss();
                  if(s=="Success"){
  
                      Intent intent = new Intent(IMEI_Val.this, CapturePhoto.class);
                     // intent.putExtra(USER_NAME,username);
                      startActivity(intent);
                  }
  
                 else{
                     Toast.makeText(IMEI_Val.this, s, Toast.LENGTH_LONG).show();
                      Log.d("Tag Name", "Log Message");
                  }
              }
  
              @Override
              protected String doInBackground(String... params) {
                  HashMap&lt;String,String&gt; data = new HashMap&lt;&gt;();
                  data.put("auid",params[0]);
                  data.put("imei",params[1]);
                  RegisterUserClass ruc = new RegisterUserClass();
                  String result = ruc.sendPostRequest(LOGIN_URL,data);
                  return result;
              }
          }
          UserLoginClass ulc = new UserLoginClass();
          ulc.execute(username,imei_no);
      }
  
  }
  </code></pre>
  
  <p>My problem is when am clicking on Login button, am getting json result in toast with student details after valid user inputs.I want to goto next activity if the the user inputs are valid and display other details like name,college etc.How can I do that?
  Here am getting json result as response when I enter valid inputs.I could not go to next activity and display other details in text box even though am entering correct regno.</p>