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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:15:05+00:00 2026-05-24T21:15:05+00:00

When attempting to execute this code in an Android Activity: Uri testurl = Uri.parse(http://www.google.com);

  • 0

When attempting to execute this code in an Android Activity:

Uri testurl = Uri.parse("http://www.google.com");
Log.v("HTTPGet", "testurl.toString == " + testurl.toString());

the only output in Logcat is a reference to a string, but not the string itself:

HTTPGet(23045): testurl.toString == [Landroid.net.Uri;@4056e398

How can I print the actual string?

  • 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-24T21:15:06+00:00Added an answer on May 24, 2026 at 9:15 pm

    ORIGINAL ANSWER (Scratch it)

    Uri.toString writes out a description of the URI object from the class Uri.

    Documentation is here: http://developer.android.com/reference/android/net/Uri.html

    To get the human readable version, invoke the getter methods defined for the class.

    THE REAL ANSWER

    The OP has clarified and provided the actual code. Here is the actual context:

    @Override
    protected Document doInBackground(Uri... arg0) {
        Document ret = null;
        Log.v("HTTPGet", "Uri.toString == " + arg0.toString());
        try {
            ret = Jsoup.connect(arg0.toString()).get();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return ret;
    }
    

    What is happening here is that the parameter arg0 has type Uri[], namely an array of Uri. The dot-dot-dot syntax is Java’s “varargs”. It means the parameter is actually an array, but rather than passing an array in the call, you can pass any number of arguments that Java will bundle up into an array.

    Because you are using a third party library, you have to override this method which takes in one or more Uris. You are assuming that only one will be used. If this is the case, you should instead write

    Log.v("HTTPGet", "Uri.toString == " + arg0[0].toString());
    

    If you really will be processing multiple uris, use a for-loop to go through and log all of them.

    Make sure to fix your Jsoup.connect line too. It doesn’t want a messy array string. 🙂

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

Sidebar

Related Questions

I keep getting this error when attempting to execute this code, even after placing
I am attempting to access Google Books in order to an ISBN Code to
I am attempting to execute a Stored Procedure within another stored procedure. The catch
I am attempting to be cheap and execute a local system command ( uname
I'm attempting to make a StateMachine execute some database action between states. So I
I'm attempting to build a Windows Service which will execute some method when a
I'm attempting to check that a file exists before including it with Server.Execute in
Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to execute an SSIS package on SQL 2005 using the following: dtexec
I'm writing a simple diagnostic query then attempting to execute it in the Oracle

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.