How to make a phone call in a Android application

This may a looks like a simple task. Actually it is a simple task. You can do it using few lines of code. But there are only few places which shows how to do it. So I decided to mention it here.


public void onCallButtonClicked(View view) {
String url = "tel:" + tpNo;
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
intent.setData(Uri.parse(url));
startActivity(intent);
}

Comments

Popular posts from this blog

Create new Java Class files at runtime

Using iReport plugin for Jasper Reports in Netbeans

Fixing Error "Failed to load VMMR0.r0 (VERR_SUPLIB_WORLD_WRITABLE)" in Virtualbox