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 8823969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:29:26+00:00 2026-06-14T06:29:26+00:00

So using google places reference (detailed web-service) i retrieved a formatted phone number its

  • 0

So using google places reference (detailed web-service) i retrieved a “formatted phone number” its in the form of (256) 922-0556. The goal is to call this number. The way I am trying is be using an intent. However, the number above is not a in the format to use Uri parse method. Anyone know a solution to call this number? Is there a different intent or a good way to turn this into Uri data? I have seen the opposite of this done like so:
1234567890 → (123) 456-7890

  String formattedNumber = PhoneNumberUtils.formatNumber(unformattedNumber);

But i want to do the reverse of this. any ideas or alternative solutions?
Here is my code:

protected void onPostExecute(Boolean result){
                Intent callintent = new Intent(Intent.ACTION_CALL);
                callintent.setData(Uri.parse(phoneNum));
                try {
                    startActivity(callintent);
                }catch (Exception e) {e.printStackTrace();}
            }

Where phoneNum is a formatted phone number string retrieved from GooglePlaces via JSON

To expand on Peotropo’s comment: is there a better way to replace values than the following?

phoneNum = phoneNum.replace(" ", ""); // gets rid of the spaces
phoneNum = phoneNum.replace("-", ""); // gets rid of the -
phoneNum = phoneNum.replace("(", ""); // gets rid of the (
phoneNum = phoneNum.replace(")", ""); // gets rid of the )
  • 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-14T06:29:27+00:00Added an answer on June 14, 2026 at 6:29 am

    This is simple string. Use String.replace() method to remove extra chars.
    You can also use replaceAll method:

    String phoneNumber = "(123)123-456465"
    return phoneNumber.replaceAll("[^0-9]", "");
    

    Not tested docs are here:
    replaceAll

    Java regular expressions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen the two forms of reference to the Google Places Library/Service, using
I am using the Google Maps places API v3 to return a number of
I'm using both a Google Places API and a Facebook iOS SDK API in
I'm using Google Maps Javascript API V3 Places Library in order to add Places
I am using the Place Searches from the Google Places API and wanted to
In our project we are using Google Mock, but in multiple places we are
Using Google Places API requires an API key. I remembered I registered for one
I have recently started using google places api and am a big noob on
I want to allow users to add places to Google Maps using my app.
I'm using Google Places API to retrieve data about places, but couldn't find how

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.