Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.app.Activity;
- import android.content.ActivityNotFoundException;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.util.Log;
- public class phonecalls extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- call();
- }
- private void call() {
- try {
- Intent callIntent = new Intent(Intent.ACTION_CALL);
- callIntent.setData(Uri.parse("tel:575757570089"));
- startActivity(callIntent);
- } catch (ActivityNotFoundException activityException) {
- Log.e("dialing-example", "Call failed", activityException);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement