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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:44:31+00:00 2026-06-18T10:44:31+00:00

In my sample news application I have a view Flipper that display news title,

  • 0

In my sample news application I have a view Flipper that display news title, you can see XML code of the ViewFlipper below.

<ViewFlipper android:id="@+id/pushFlipper"
        android:layout_width="fill_parent"
        android:layout_height="25dp"
        android:background="#90333333"
        android:flipInterval="4000"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginBottom="10dip"
        >

    </ViewFlipper>

Dynamically I add TextViews to this ViewFlipper in order to display the news title in animated form. Here is the code where I add TextViews to the Flipper.

Now, the issue I am facing is how to set listener on the dynamic TextViews, that I could display the appropriate news descriptionin new Activity of the title that has been displayed on the textview. Please help me in this respect, your help would be greatly appreciated.

pushFlipper = ((ViewFlipper) this.findViewById(R.id.pushFlipper));
            pushFlipper.startFlipping();
try
            {
                RSSdata = new RSSHandler();
                for (int i = 2; i < RSSdata.getTitle().size(); i++)
                {
                    TextView tvNewsRSS = new TextView(this);
                    tvNewsRSS.setText(RSSdata.getTitle().get(i).toString());
                    tvNewsRSS.setTextColor(Color.parseColor("#FFFFFF"));
                    tvNewsRSS.setTextSize(14);
                    tvNewsRSS.setGravity(Gravity.CENTER_VERTICAL);

                    pushFlipper.addView(tvNewsRSS);

                }     
            }
            catch(Exception e)
            {
            }
  • 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-18T10:44:32+00:00Added an answer on June 18, 2026 at 10:44 am

    One of the solution can be getting newsId on click of item from textview tag and then using this newsId in next activity to fetch and show appropriate news.

    Code:

    try
        {
    
            for (int i = 0; i < 10; i++)
            {
                TextView tvNewsRSS = new TextView(this);
                tvNewsRSS.setText(RSSdata.getTitle().get(i));
                tvNewsRSS.setTextColor(Color.parseColor("#FFFFFF"));
                tvNewsRSS.setTextSize(14);
                tvNewsRSS.setTag(RSSdata.getId().get(i));
                tvNewsRSS.setGravity(Gravity.CENTER_VERTICAL);
                tvNewsRSS.setOnClickListener(new OnClickListener() {
    
                    @Override
                    public void onClick(View v) {
                        String newsId = v.getTag().toString();
    
                        // Pass this newsId to next activity via intent putExtra.
    
                    }
                });
                pushFlipper.addView(tvNewsRSS);
    
            }     
        }
        catch(Exception e)
        {
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I'm working on an application that will have a UITableView for a news
So I have a set of data that can look like this (sample line-by-line):
Can anyone tell me how to make my sample below <?xml version=1.0 encoding=utf-8?> <LinearLayout
I have downloaded TableView sample code '4_TableViewCellSubviews' from internet. I am trying to run
I have a quite simple doctrine entity that represent a news ; this news
I am making an Android application that can fetch the new announcements from the
I need to create one sample application for NITF-News Industry Text Format in iphone.
I am working on a web application with an existing code base that has
I have an application that is using the new Bing API from the Azure
As described in the sample on documents, we can retrieve the user's news feed

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.