String statuss = LoginActivty.review_status;
Toast.makeText(MainActivity.this, "noman :"+ statuss, Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, "shah:"+ LoginActivty.review_status
, Toast.LENGTH_SHORT).show();
if(statuss != "Reviewed"){
ratingDialog();
// Toast.makeText(MainActivity.this, "Well come back", Toast.LENGTH_SHORT).show();
}else if(statuss == "Not_Review") {
Toast.makeText(MainActivity.this, "Well come back", Toast.LENGTH_SHORT).show();
}
}
当我静态传递status
时,它完美无缺,但是当我动态传递LoginActivty.review_status
时,它无效。为什么呢?
答案 0 :(得分:1)
您应该使用等于()而不是 ==
if(!statuss.equals("Reviewed"))
{
ratingDialog();
// Toast.makeText(MainActivity.this, "Well come back", Toast.LENGTH_SHORT).show();
}else if(statuss.equals("Not_Review"))
{
Toast.makeText(MainActivity.this, "Well come back", Toast.LENGTH_SHORT).show();
}