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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:43:01+00:00 2026-05-30T00:43:01+00:00

Im trying to display hyperlinks (formated as hyperlink) in a listview row but not

  • 0

Im trying to display hyperlinks (formated as hyperlink) in a listview row but not having any luck. First I inflate the news_row view to a class variable in onCreateView for later

news_row = (LinearLayout) inflater.inflate(R.layout.news_row,null);

I call setNews in onActivityCreate and look for the textview with hyperlinks and then popular the rows:

public void setNews(){           

        TextView textcontent = (TextView) news_row.findViewById(android.R.id.text2);
        textcontent.setMovementMethod(LinkMovementMethod.getInstance());

        String[] matrix = {"_id", "title", "content", "date"};
        String[] columns = {"title", "content", "date"};
        int[] layouts = {android.R.id.text1,android.R.id.text2, R.id.text3};

        MatrixCursor cursor = new MatrixCursor(matrix);
        for(int i = 0 ; i < straNewsTitle.length; i++) {
            cursor.addRow(new Object[] {i, straNewsTitle[i], Html.fromHtml(straNewsContent[i]), straNewsDate[i] });
        } 
        SimpleCursorAdapter a = new SimpleCursorAdapter(fa, R.layout.news_row, cursor, columns, layouts);           
        setListAdapter(a);
}

straNewsContent holds body text for a news item which may contain html hyperlink tags. My news_row layout:

<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#ffefe5" android:orientation="vertical" android:paddingLeft="15px" android:paddingRight="15px" android:paddingBottom="5px" android:paddingTop="5px">
<TextView
    android:id="@android:id/text1"
    android:gravity="top"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textColor="#666666" 
    android:textSize="20dp"
    android:background="#ffefe5"
    android:textStyle="bold"
/>
<TextView
    android:id="@android:id/text2"
    android:gravity="bottom"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@android:id/text1"
    android:textColor="#666666" 
    android:textSize="15dp"
    android:background="#ffefe5"
    android:autoLink="web|email" 
/>
<TextView
    android:id="@+id/text3"
    android:gravity="bottom"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@android:id/text1"
    android:textColor="#666666" 
    android:textSize="12dp"
    android:background="#ffefe5" 
/>
</LinearLayout> 

android:autoLink=”web|email” works great for strings that are formatted urls but html tags aren’t being rendered. Any help would be awesome.

  • 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-30T00:43:03+00:00Added an answer on May 30, 2026 at 12:43 am

    Figured it out. I had to implement my own BaseAdapter and make the change in getView().

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

Sidebar

Related Questions

I've been trying to display text using a Quartz context, but no matter what
I'm trying to display a hyperlink clickable in a inputtextarea is that possible? If
I'm trying to create a page with a hyperlinks that when clicked will display
im trying to display data on the footer in jqgrid, but it only displays
I'm trying to display tooltips in Java which may or may not be paragraph-length.
gcc 4.4.4 c89 However, I am having a problem trying to display all the
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
When trying to display a byte stream from HLDS (Half-Life Dedicated Server) in a
I'm trying to display a series of titles varying from 60 characters to 160
I am trying to display a list of all files found in the selected

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.