Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7056953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:55:42+00:00 2026-05-28T03:55:42+00:00

My droid app has a button on the main page that gives you an

  • 0

My droid app has a button on the main page that gives you an dialogue popup page and asks within the dialogue page whether you want to make a phone call or not

Ive tried and over and over and haven’t quite figured out how to get the button to make a phone call

My opening java page
package your.package2.phonecalls;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ButtonphonecallsActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Button TheCallButton = (Button) findViewById(R.id.phonecallbutton);  
    TheCallButton.setOnClickListener(new View.OnClickListener() {  

        public void onClick(View v) {
            final Dialog dialog = new Dialog(ButtonphonecallsActivity.this);
            dialog.setContentView(R.layout.alertphonecall);
            dialog.setTitle("Zohan contact number");

            Button Nosir = (Button) dialog.findViewById(R.id.nobutton);  
            Nosir.setOnClickListener(new View.OnClickListener() {  
                @Override               
                public void onClick(View v) {
                    dialog.cancel();
                    } 
            });   

            Button Yessir = (Button) dialog.findViewById(R.id.yesbutton);
            Yessir.setOnClickListener(new OnClickListener() {
                @Override               
                public void onClick(View v) {
                    dialog.cancel();
                    startActivity(new Intent(ButtonphonecallsActivity.this, makingaphonecall.class));        
                }
            });

            dialog.show();
        }
    });
}
}

The phone call activity

package your.package2.phonecalls;

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 makingaphonecall extends Activity {
@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:7578263678"));
    startActivity(callIntent);
} catch (ActivityNotFoundException activityException) {
     Log.e("helloandroid dialing example", "Call failed");
}
}

}

android manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package2.phonecalls"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" 
    android:debuggable="true" >

    <activity
        android:name=".ButtonphonecallsActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".makeaphonecall"
        android:label="@string/app_name" >
    </activity>

    </application>

</manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:55:43+00:00Added an answer on May 28, 2026 at 3:55 am

    Why r u making a separate activity to make a phone call? Simply add below two lines into your onclick.

    Intent dialer = new Intent(Intent.ACTION_CALL,Uri.parse("tel:7578263678"));
    startActivity(dialer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android app for which i need to ensure that it has
My Droid phone has OS 2.1 and the per-app VM budget is 24M bytes.
I'm trying to develop an app that uses opengl on android, and ideally make
I'm running my android app on my droid x2 device. this app has a
I noticed that whenever I tested my app on my Droid X and Droid
Synopsis: I am developing a HTML5 web app that will allow tablets(iPad or Droid)
I'm running my android app on my droid x2 device. this app has a
All right, I'm at my wit's end. I'm writing a droid app that receives
I'm writing a social networking app that has contacts sync functionality. I have working
I have a Droid X, which has a physical camera button. I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.