I am developing an application which contain SMS, Audio Calls and Call Log history. But also i need to add video calls to my applications. I tried a code as below, but It throws ActivityNotFoundException. Please help me to make video calls.
Intent callIntent = new Intent("com.android.phone.videocall");
callIntent.putExtra("videocall", true);
callIntent.setData(Uri.parse("tel:" + number));
callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(callIntent);
Any help will be appriciated....
You can check if the object's reference is null
:
if(acode == null || acode.equals("")) {
}
the condition is true if acode is null or if is not null and is equal to an empty string. In addition, android you can use
if (TextUtils.isEmpty(acode)) {
}
that checks both for null and empty string, making your if condition more compact. From the documentation of isEmpty
Returns true if the string is null or 0-length.