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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:39:19+00:00 2026-06-10T14:39:19+00:00

I have a text view with multiple lines of text e.g. This is line

  • 0

I have a text view with multiple lines of text e.g.

This is line 1

This is line 2

This is line 3

I want to be able to store the text depending on which line the user has clicked, i.e. if they click on line 2 I want to store “This is line 2”.

How can I go about this?

Edited 1 Sept:

I am not sure how the clickable span solution would work? I am able to get a specific line of text from my text view e.g. to get line 1 I would use:

TextView tv = (TextView) view.findViewById(R.id.class_list);
String selectedClass =(String)(tv).getText();
int l1start = tv.getLayout().getLineStart(1);
int l1end = tv.getLayout().getLineEnd(1);
String l1 = selectedClass.substring(l1start, l1end);

But I can’t see how to work out which line number has actually been clicked by using clickable span?

  • 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-10T14:39:21+00:00Added an answer on June 10, 2026 at 2:39 pm

    You can use a clickable span . Set a different span for each line and When clicked onClick method for this clickable span will be called.

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

Sidebar

Related Questions

I need to have various text view on a single line. And I want
I have a multi-line text view that can get quite large. When the user
I have a text view. What I want is when I select the text
I have Auto completed text view,i want to filter the items present in the
I have Text( http://www.mywebsite.com ) in a view, in which i need to provide
I have a view. the view has a function that returns a text string
I have this partial view rendered multiple times on a page: @model POS.Domain.Entities.Category <div
I have an UITextView which can have multiple lines. All I'm interested in is
In my application,i have text view with long text. i need text wrapping like
http://dl.dropbox.com/u/24856/android_issue.PNG i have a text view on top running into the relative layout with

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.