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

  • Home
  • SEARCH
  • 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 7976701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:58:45+00:00 2026-06-04T08:58:45+00:00

I have a Method that makes a phone call. The number and delay comes

  • 0

I have a Method that makes a phone call. The number and delay comes from strings in two edit text box’s. It works fine. But, i would like to put it in a loop so that it does the same this a number of times before it ends.

My code is –

public void makeCall(View view) {

             //create handler for phone call

         Handler delayedCallHandler = new Handler() {
              public void handleMessage(Message msg) {
                String num = (String) msg.obj;

                Intent intent = new Intent(Intent.ACTION_CALL);
                intent.setData(Uri.parse(num));
                startActivity(intent);
              }
            };


            //Grabs milli seconds count from edit text box

               EditText edit_seconds = (EditText)
                    findViewById(R.id.seconds);
               CharSequence edit_seconds_value =
                    edit_seconds.getText();

               int secondz = Integer.parseInt(edit_seconds_value.toString());                    

            // Grabs TXT Char from MSISDN edit text box and converts to edit_text_value
            EditText edit_text = (EditText)
                    findViewById(R.id.msisdn);
               CharSequence edit_text_value =
                    edit_text.getText();

            //Delay phone call

            delayedCallHandler.sendMessageDelayed(
                    delayedCallHandler.obtainMessage(0, "tel:" + edit_text_value), // msg.obj = the number to call
                    secondz); // 50 seconds

            // Toast Popup when call set button pressed

            Toast toast=Toast.makeText(this, "You have now set the call for " + edit_seconds_value + "milliseconds" , Toast.LENGTH_LONG); 
            toast.show();  

    }        
  • 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-06-04T08:58:47+00:00Added an answer on June 4, 2026 at 8:58 am

    You can launch the CALL activity with startactivityForResult(). Then in the OnActivtyResult send a delayed message to start the next CALL.

    @Override
    void onActivityResult(...) {
       ....
       if (count <= NUMBER_OF_CALLS) {
           delayedCallHandler.sendMessageDelayed(
                        delayedCallHandler.obtainMessage(0, "tel:" + edit_text_value), // msg.obj = the number to call
                        secondz); // 50 seconds
           count++;
       }
       ....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method in App Delegate that makes a window and content view
I have a program that makes use of the following method to get a
I have a method: myMethod() {} that I want to make accessible to javascript.
I have method in a class that I need to make sure is only
I have a method that accepts an IEnumerable-decimals and performance various math functions. I
I have a method that takes a list of entities ( Class es) and
I have this method that changes an larger image source on click. I need
I have a method that returns a list of type string. I want to
I have a method that accepts a sender and is called with a UIbutton.
I have a method that takes an array of queries, and I need to

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.