AI2 Component  (Version nb184)
PhoneCallUtil.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2012 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 
7 package com.google.appinventor.components.runtime.util;
8 
9 import android.content.Context;
10 import android.content.Intent;
11 import android.net.Uri;
12 
21 public class PhoneCallUtil {
22 
23  private PhoneCallUtil() {
24  }
25 
26  public static void makePhoneCall(Context context, String phoneNumber) {
27  if (null != phoneNumber && phoneNumber.length() > 0) {
28  Uri phoneUri = Uri.parse("tel:" + phoneNumber); // Could also use Uri.Builder
29  Intent intent = new Intent(Intent.ACTION_CALL, phoneUri);
30  context.startActivity(intent);
31  }
32  }
33 }
34 
com.google.appinventor.components.runtime.util.PhoneCallUtil
Definition: PhoneCallUtil.java:21
com.google.appinventor.components.runtime.util.PhoneCallUtil.makePhoneCall
static void makePhoneCall(Context context, String phoneNumber)
Definition: PhoneCallUtil.java:26