Misc re #1751: changing Android java's String.isEmpty() to String.length()==0 for better portability since the former is only available on API level 9

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4870 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2014-07-03 09:43:19 +00:00
parent 1d55a26625
commit cd7a313a58
2 changed files with 4 additions and 4 deletions

View File

@ -243,7 +243,7 @@ public class MainActivity extends Activity implements Handler.Callback, MyAppObs
LayoutInflater li = LayoutInflater.from(this);
View view = li.inflate(R.layout.dlg_account_config, null);
if (!lastRegStatus.isEmpty()) {
if (lastRegStatus.length()!=0) {
TextView tvInfo = (TextView)view.findViewById(R.id.textViewInfo);
tvInfo.setText("Last status: " + lastRegStatus);
}
@ -288,12 +288,12 @@ public class MainActivity extends Activity implements Handler.Callback, MyAppObs
accCfg.getRegConfig().setRegistrarUri(registrar);
AuthCredInfoVector creds = accCfg.getSipConfig().getAuthCreds();
creds.clear();
if (!username.isEmpty()) {
if (username.length() != 0) {
creds.add(new AuthCredInfo("Digest", "*", username, 0, password));
}
StringVector proxies = accCfg.getSipConfig().getProxies();
proxies.clear();
if (!proxy.isEmpty()) {
if (proxy.length() != 0) {
proxies.add(proxy);
}

View File

@ -179,7 +179,7 @@ class MyBuddy extends Buddy {
if (bi.getSubState() == pjsip_evsub_state.PJSIP_EVSUB_STATE_ACTIVE) {
if (bi.getPresStatus().getStatus() == pjsua_buddy_status.PJSUA_BUDDY_STATUS_ONLINE) {
status = bi.getPresStatus().getStatusText();
if (status == null || status.isEmpty()) {
if (status == null || status.length()==0) {
status = "Online";
}
} else if (bi.getPresStatus().getStatus() == pjsua_buddy_status.PJSUA_BUDDY_STATUS_OFFLINE) {