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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:51:06+00:00 2026-05-17T23:51:06+00:00

I have a working android app using TextView, some formatting (line breaks, rows of

  • 0

I have a working android app using TextView, some formatting (line breaks, rows of dashes) and Linkify to generate a primitive “ListView-like” display with clickable URLs in each “row”. I’d like to move up to a real ListView, but I’m just not finding the sample/explanation that I need to take that next step.

I have successfully reproduced the HelloListView sample, starting with the hardcoded string array, and moving to a string array defined in my res/values/strings.xml. I’ve taken one small step toward my goal by adding my HttpClient code to retrieve a set of data from a service, parse the results into a String Array and feed that into setListAdapter() such that my text and links show up as text-only in ListView items.

I want to move to the next step which is to make each “row” in my ListView launch the browser to the URL contained in the data, either by
(A) clicking anywhere in the row, or
(B) clicking a hyperlink displayed within the row data

For option (A), it appears that I need to have my onItemClick() method issue an intent that launches the browser. That’s straightforward, but I don’t get how to associate the URL with the item (currently its just one part of the string content for each “row” of text). How do I separate my URL from the rest of the text, such that I can launch a browser to the corresponding URL? Do I need to replace my String Array with an array of custom objects?

For option (B), can I use Linkify? It seems that my string array elements get converted to individual TextViews (inferring from the way the Toast text is generated in the HelloListView sample). Do I have access to that TextView to run Linkify against? Do I need to replace my String Array with a TextView Array and run Linkify myself? Am I completely off base?

Thanks to anyone who can help explain back to me what I’m trying to do, in a way that helps to find my way around the SDK, samples and other helps!

  • 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-17T23:51:06+00:00Added an answer on May 17, 2026 at 11:51 pm

    How do I separate my URL from the rest of the text, such that I can launch a browser to the corresponding URL?

    Use a regular expression (java.util.regex) to find the URL.

    For option (B), can I use Linkify?

    Yes.

    Do I have access to that TextView to run Linkify against?

    Yes. Override getView() in your ArrayAdapter. Chain to the superclass and get your TextView from the result of super.getView().

    Even better would be to use Linkify on your strings before putting them in the array in the first place.

    Do I need to replace my String Array with a TextView Array and run Linkify myself?

    No, and that is really not a good idea. Here is a free excerpt from one of my books that goes into more detail on tailoring the individual rows of a ListView, in case this helps.

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

Sidebar

Related Questions

I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working on some legacy C++ code that uses variable length structures
I have a working copy of my project, checked out using Subversion 1.5.1. When
I have been working on a web services related project for about the last
I have been working with a string[] array in C# that gets returned from
We have been working with CVS for years, and frequently find it useful to
I have a working LINQ to SQL model. I want to be able to
I have this working definition: IDENTIFIER [a-zA-Z][a-zA-Z0-9]* I don't want to keep repeating the
I have been working with relational databases for sometime, but it only recently occurred
I have been working as a native C++ programmer for last few years. Now

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.