Android check null or empty string in Android

前端 未结 10 1510
梦如初夏
梦如初夏 2020-12-13 12:07

In my trying AsyncTask I get email address from my server. In onPostExecute() I have to check is email address empty or null

10条回答
  •  感动是毒
    2020-12-13 12:43

    From @Jon Skeet comment, really the String value is "null". Following code solved it

    if (userEmail != null && !userEmail.isEmpty() && !userEmail.equals("null")) 
    

提交回复
热议问题