Stuff that Happens

Main Menu

  • Home
  • About
  • Contact Us

logo

  • Home
  • About
  • Contact Us

Login

Welcome! Login in to your account
Lost your password?

Lost Password

Back to login
Android
Home›Android›Accessing the Dialer

Accessing the Dialer

By stufftha_user
November 19, 2008
196
0
Share:

This is how easy it is to activate the Android dialer:

startActivity(new Intent(ACTION_DIAL, Uri.parse("tel:6365551212")));

And here is a complete Activity that shows the code in context. Specifically, this code:

  • Creates a screen (an “Activity”) with a button
  • Registers a listener with the button
  • When you click the button, it starts the dialer
  • When dialing completes, the user returns to this screen
public class DialerDemo extends Activity {      @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);          Button dialButton = (Button) findViewById(R.id.dial_button);         dialButton.setOnClickListener(new OnClickListener() {              @Override             public void onClick(View v) {                 dialPhone();             }         });     }      private void dialPhone() {         Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri                 .parse("tel:6365551212"));         startActivity(dialIntent);     } }

When you run this you see a button:

Clicking the button brings up the dialer, with the number pre-typed:

Then you hit the green phone button to make the call:

Making the Call

You can also write code that actually makes the phone call using the ACTION_CALL intent. For that to work, your manifest needs to include the CALL_PHONE permission.

Perhaps you could use this feature to keep track of your kids. If they venture too many miles away from home, you could have their phone automatically dial home.

Posted on Wednesday, November 19th, 2008 at 11:26 pm in Android.

Previous Article

Graphics Help!

Next Article

Introduction to Android

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

stufftha_user

Related articles More from author

  • Android

    Android Development Flow

    November 5, 2008
    By stufftha_user
  • Android

    State Capitals 1.1.0

    October 17, 2009
    By Kenneth
  • Android

    Android Lifecycle Triggers, Part 2

    November 26, 2008
    By stufftha_user
  • Android

    Android Mystery Box

    October 16, 2009
    By Kenneth
  • Android

    Apple is not Worried

    April 30, 2009
    By stufftha_user
  • Android

    My Favorite Android Permission

    November 19, 2008
    By stufftha_user

Leave a reply Cancel reply

You may interested

  • Opinion

    Interfaces and Implementations

  • Opinion

    U.S. Music Royalty Fee

  • Opinion

    No More Word

Newsletter

Follow us

Dui viverra Faucibus aliquet quis phasellus accumsan. Donec et facilisis sociosqu sed tortor elit eu aliquid turpis ridiculus.

Fly, shall, have greater fifth spirit midst under from stars thing is, had creepeth multiply kind. Man may they’re meat years have third bring replenish air two light deep fill.

About us

Stuffthathappens is a blog about Android features, new gadgets, new apps, phone reviews, tech support and the nitty-gritty of modern day communication.
  • Recent

  • Popular

  • Comments

  • android

    Android Color Banding

    By Kenneth
    October 25, 2018
  • HTC EVO Review

    By Kenneth
    October 20, 2018
  • Interfaces and Implementations

    By Kenneth
    October 15, 2018
  • Android Robot

    By Kenneth
    October 11, 2018
  • android

    Android Color Banding

    By Kenneth
    October 25, 2018
  • ZDNet: The Computer Experts

    By stufftha_user
    March 3, 2008
  • Ouch…Malaysian Post

    By stufftha_user
    March 4, 2008
  • Chet: I’m Sorry

    By stufftha_user
    March 4, 2008
  • A WordPress Commenter
    on
    April 22, 2018

    Hi, this is a ...

Instagram

  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image

Follow us

  • Contact
  • Contact
  • About Us
  • About Us
  • Home
  • Home
© Copyright 2018. Stuff That Happens. kenneth@stuffthathappens.com
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy