Here you can find the source of call(String aPhoneNumber, Activity aActivity)
Parameter | Description |
---|---|
String | aPhoneNumber phone number to call |
Activity | aActivity activity needed for startActivity() |
public static void call(String aPhoneNumber, Activity aActivity)
//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); } }