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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:00:56+00:00 2026-06-03T13:00:56+00:00

I have created an Android RSS Reader App.I have a text marquee in my

  • 0

I have created an Android RSS Reader App.I have a text marquee in my android app.Iam fetching RSS feed and store RSS title as an array.Iam setting this array as the marque text.Check the code,

String MarqueeStr="";
TextView flashnews;

for (int i = 0; i < nl.getLength(); i++) {

    MarqueeStr = MarqueeStr +" | "+ Headlines.Title[i];
        }

           flashnews.setText(MarqueeStr);

Now I have to set an onclick listener for my marquee, so that user can view detailed description of title which they are clicked.I know how to set it.But my problem is, how can i get the array index of clicked string in the marquee text when a user click on the marquee?

here is my XML layout,

<TextView
  android:id="@+id/flashs"
  android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:lines="1"
    android:ellipsize="marquee"
    android:layout_marginLeft="70dp"
    android:fadingEdge="horizontal"
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true"
    android:singleLine="true"
    android:textColor="#e7e7e7" />

screen shote here..

enter image description here

can you see that “Latest News”? its my marquee text

  • 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-03T13:00:57+00:00Added an answer on June 3, 2026 at 1:00 pm

    I think that will only be possible if you will create your textviews dynamically and set id for them. like if you are having 10 news link then use 10 textviews

            TextView txt = null;
            View.OnClickListener marquee_click = new View.OnClickListener() {
    
                @Override
                public void onClick(View v) {
                    int selected_item = v.getTag();
                    switch (selected_item) {
                    case 0:
    
                        break;
                    case 1:
    
                        break;
                    case 2:
    
                        break;
                    default:
                        break;
                    }
                }
            };
    
    
            LinearLayout news_text_layout = new LinearLayout(getApplicationContext());
            news_text_layout.setOrientation(LinearLayout.HORIZONTAL);
    
            for (int i = 0; i < 10; i++) {
                txt = new TextView(getApplicationContext());
                txt.setTag(i);   // OR txt.setId(i);
                txt.setText("new " + i);
                txt.setOnClickListener(marquee_click);
                news_text_layout.addView(txt);
            }
            // ADD YOUR LINEAR LAYOUT ON WHICH YOU HAVE ADDED ALL TEXT VIEW IN YOUR LISTVIEW FOOTER.
            // NOW PERFORM SAME ANIMATION OR TRICK ON LINEAR LAYOUT WHICH YOU WERE PERFORMING ON marquee text.
    

    Hope it can help you…

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

Sidebar

Related Questions

I have created a MazeSolver android app for a school project. I am using
I have created an App Widget for Android 1.5. It uses a TextView to
I have created a small and simple android app. I tried installing it on
I have a problem regarding Android App. I have created an application that download
I have an Android app created with Adobe AIR and Flex. How can I
I have created a database for my android app which contains static data and
I have created a Java code for my Android App. String[] MovieName=new String[]{}; for
I have created the Android version of an ios app and am looking for
I have created one android app in which I am starting a service by
I have successfully created an Android app that calculates prices and then is able

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.