Android Intent Create call(String aPhoneNumber, Activity aActivity)

Here you can find the source of call(String aPhoneNumber, Activity aActivity)

Description

Calls a phone number

License

Mozilla Public License

Parameter

Parameter Description
String aPhoneNumber phone number to call
Activity aActivity activity needed for startActivity()

Declaration

public static void call(String aPhoneNumber, Activity aActivity) 

Method Source Code

//package com.java2s;
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Author: Michael Kohler <mkohler@picobudget.com>
 * Contributors:/*from ww  w.  j a  v  a 2 s  . c  o m*/
 *  - Michael Kohler <mkohler@picobudget.com>
 *  */

import android.app.Activity;

import android.content.Intent;

import android.net.Uri;

public class Main {
    /**
     * Calls a phone number
     *
     * @author Michael Kohler
     * @param String aPhoneNumber phone number to call
     * @param Activity aActivity activity needed for startActivity()
     */
    public static void call(String aPhoneNumber, Activity aActivity) {
        Intent callIntent = new Intent(Intent.ACTION_CALL);
        callIntent.setData(Uri.parse("tel:" + aPhoneNumber));
        aActivity.startActivity(callIntent);
    }
}

Related

  1. organizeAndStart(Activity activity, Class classes, Map paramMap)
  2. onKeyBackGoHome(Activity activity, int keyCode, KeyEvent event)
  3. makeCall(Activity activity, String telNumber)
  4. PhotoIntent(Activity activity)
  5. VideoIntent(Activity activity)
  6. intentSysDefault(Activity activity, Class classes, Map paramMap)
  7. audioBecomingNoisy(Context c)
  8. launchUrlInBrowser(Context context, String url)