protected void onPostExecute(String result) {
if (result.equals("complete")) {
try{
if (s.equalsIgnoreCase("true"))
{
Toast.makeText(getApplicationContext(), "Logging in...", Toast.LENGTH_SHORT).show();
Intent i = new Intent(context,Show.class);
startActivity(i);}
else {
Toast.makeText(context, "Invalid UserID/Password", Toast.LENGTH_SHORT).show();
}
}catch (Exception e){
Toast.makeText(context, "NO Internet Connection", Toast.LENGTH_SHORT).show();}
mProgressDialog.dismiss();
}
}
我正在回复" true"如果登录成功并且" false"如果登录不成功作为JSONstring但控件不在if块中。无论jsonstring值如何,它都会直接转到else块。