每次得到来自else块的结果都不能得到来自if块的所有时间显示来自else块的结果,如何解决这个问题请帮帮我。这是我的代码:
protected void onPostExecute(String result) {
if (pd != null) {
pd.dismiss();
}
try {
Log.d("Request : 2 ", "" + result);
if (result.equals("1")) {
Toast.makeText(RegistrationPatient.this, "You Have Submited Successfully", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(RegistrationPatient.this, DuraentMenu.class);
startActivity(intent);
} else {
TextView txt2 = (TextView) findViewById(R.id.textView2);
txt2.setText("not available");
}
} catch (Exception ex) {
ex.printStackTrace();
}
}