I am checking String whether it's null or not but I don't know why it's always enter into if block 
 Log.d(TAG,"String ID  "+str);
 if (str!= null && !str.isEmpty()){
    Log.d(TAG,"String ID is not Null ");                 
 } else {
    Log.d(TAG,"String ID is Null ");            
 }
I also generate logs to check String value before checking if condition and it shows like this
01-06 07:17:46.128 30321-30376/com.example D/### String Checker ###: Page ID  null
01-06 07:17:46.128 30321-30376/com.example D/### String Checker ###: Page ID is not Null 
Update:
Setting String to null then calling other class like this
String str = null;
new AsyncTask(searchInterfaceChat,getActivity(),String.valueOf(str)).execute(query);
 
     
     
     
     
    