java - A method should return an empty string, but it is not an empty string. What does it return? -
private string getmyphonenumber(){ telephonymanager mtelephonymgr; mtelephonymgr = (telephonymanager) getsystemservice(context.telephony_service); return mtelephonymgr.getline1number(); }
this method should return phone number or null
, when try check returned parameter, see not empty string:
public void setmyphonenumber(){ if (getmyphonenumber() == null){ myphonenumberdialog(); } else { myphonenumber = getmyphonenumber(); toast(getmyphonenumber()); } }
what method return?
returns phone number string line 1, example, msisdn gsm phone. return null if unavailable.
null
isn't equal ""
(empty string
).
Comments
Post a Comment