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

  • Home
  • SEARCH
  • 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 8134849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:11:48+00:00 2026-06-06T10:11:48+00:00

For Eg : Follow @SoccerBible, RT this & if Ronaldo scores https://bit.ly/133/com tonight we’ll

  • 0

For Eg :

Follow @SoccerBible, RT this & if Ronaldo scores
https://bit.ly/133/com tonight we’ll give away a pair of Nike Clash
Vapor 8’s to one lucky winner! #RonaldoComp

In my listview component. Where i am showing list of tweets. I have colored the @,# and urls in the tweet text. The all are dynamically clickable.

My question is how can i make the non-colored text as clickable. I have used Linkify.addLinks and Pattern API to make them clickable. But i wanted the non @,# and url text to be clicakble without adding any color to it.

Thanks,
dominic

  • 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-06T10:11:50+00:00Added an answer on June 6, 2026 at 10:11 am

    For twitter app, I had also the same requirement to click on handles of tweets and also click on the text of tweet to get Tweet detail.

    For that I have used this LinkEnabledTextView and that become easy for me to do the task.

    I just added the class in my project and then in List Item instead simple TextView I used object/instance of the LinkEnabledTextView.

    There is a complete demo in above link, Please check that.

    EDIT: Adapter Code Specially check onTextLinkClick() and then holder.twtdata.setOnClickListener()

        private static class EfficientAdapter extends BaseAdapter implements TextLinkClickListener {
            private LayoutInflater mInflater;
            static int pos =0;
            public EfficientAdapter(Context context) {
                mInflater = LayoutInflater.from(context);
            }
    
            public int getCount() {
                return timelines.length;
            }
    
            public Object getItem(int position) {
                return position;
            }
    
            public long getItemId(int position) {
                return position;
            }
    
            public View getView(final int position, View convertView,
                    ViewGroup parent) {
    
                ViewHolder holder;
                if (convertView == null) {
                    convertView = mInflater.inflate(R.layout.listtimerow, null);
                    holder = new ViewHolder();
                    holder.twtdata = (LinkEnabledTextView) convertView
                            .findViewById(R.id.twtdata);
                    holder.twtnm = (TextView) convertView
                            .findViewById(R.id.twthandle);
                    holder.twtimg = (ImageView) convertView
                            .findViewById(R.id.avatar);
                    holder.twtdt = (TextView) convertView
                            .findViewById(R.id.created);
                    convertView.setTag(holder);
                } else {
                    holder = (ViewHolder) convertView.getTag();
                }
                   holder.twtdata.setOnTextLinkClickListener(this);
                    holder.twtdata.gatherLinksForText(timelines[position]);
                    holder.twtdata.setTextColor(Color.BLACK);
                    holder.twtdata.setLinkTextColor(Color.BLUE);
    
                    MovementMethod m = holder.twtdata.getMovementMethod();
                    if ((m == null) || !(m instanceof LinkMovementMethod)) {
                        if (holder.twtdata.getLinksClickable()) {
                            holder.twtdata.setMovementMethod(LinkMovementMethod.getInstance());
                        }
                    }
    
                if (bmpimg1[position] != null)
                    holder.twtimg.setImageBitmap(bmpimg1[position]);
                holder.twtnm.setText(twitterhandles[position]);
                Date credate = new Date(created[position]);
    
                String dt = credate.getDate() + " "
                        + getMonthName(credate.getMonth());
                holder.twtdt.setText(dt);
    
                holder.twtdata.setOnClickListener(new OnClickListener() {
    
                    public void onClick(View v) {
                        pos = position;
                        if(linkselected==true)
                            return;
                        childSelected = true;
    
                        Log.i("mention data", timelines[position]);
                        Intent textintent = new Intent(ctx, TimelineRe.class);
                        textintent.putExtra("userid", userid[position]);
                        textintent.putExtra("nm", twitterhandles[position]);
                        textintent.putExtra("msg", timelines[position]);
                        textintent.putExtra("pos", position);
                        textintent.putExtra("frm", "t");
                        textintent.putExtra("img", bmpimg1[position]);
    
                        if (urlentities[position] != null
                                && dpurlentities[position] != null) {
                        textintent.putExtra("urlentity", urlentities[position]);
                        textintent.putExtra("dpurlentity", dpurlentities[position]);
                        }
                        textintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    
                        ctx.startActivity(textintent);
                    }
                });
                holder.twtnm.setOnClickListener(new OnClickListener() {
    
                    public void onClick(View v) {
                        childSelected = true;
                        Intent iconintent = new Intent(ctx, TweetRe.class);
                        iconintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        iconintent.putExtra("userid", userid[position]);
                        iconintent.putExtra("pos", position);
                        iconintent.putExtra("frm", "t");
                        iconintent.putExtra("img", bmpimg1[position]);
                        ctx.startActivity(iconintent);
                    }
                });
                holder.twtimg.setOnClickListener(new OnClickListener() {
    
                    public void onClick(View v) {
                        childSelected = true;
                        Intent iconintent = new Intent(ctx, TweetRe.class);
                        iconintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        iconintent.putExtra("userid", userid[position]);
                        iconintent.putExtra("pos", position);
                        iconintent.putExtra("frm", "t");
                        iconintent.putExtra("img", bmpimg1[position]);
                        ctx.startActivity(iconintent);
                    }
                });
                return convertView;
    
            }
            @Override 
            public int getItemViewType(int position) { 
                return position; 
            } 
    
            @Override 
            public int getViewTypeCount() { 
                return timelines.length;
            } 
            static class ViewHolder {
    
                TextView twtdt;
                LinkEnabledTextView twtdata;
                ImageView twtimg;
                TextView twtnm;
            }
    
            public void onTextLinkClick(View textView, String clickedString)
            {
                if (isWiFiConnected == false) {
                    Toast.makeText(ctx,
                            "No Internet Connection \nPlease Check and Retry",
                            Toast.LENGTH_SHORT).show();
    
                    return;
                }
                android.util.Log.v("Hyperlink clicked is :: " + clickedString, "Hyperlink clicked is :: " + clickedString);
                if(clickedString.charAt(0)=='#')
                {
                    linkselected=true;
                    childSelected=true;
                    Intent reintent = new Intent(ctx,
                            Search.class);
                    reintent.putExtra("frm", "l");
                    reintent.putExtra("keyword",clickedString.substring(1, clickedString.length()) );
                    reintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    ctx.startActivity(reintent);
                }
                else if(clickedString.charAt(0)=='@')
                {
                    linkselected=true;
                    childSelected=true;
                    Intent iconintent = new Intent(ctx, TweetRe.class);
                    iconintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    iconintent.putExtra("snm", clickedString.substring(1,clickedString.length()));
                    iconintent.putExtra("frm", "l");
    //              iconintent.putExtra("userid", userid[pos]);
    //              iconintent.putExtra("pos", pos);
    
    //              iconintent.putExtra("img", bmpimg2[pos]);
                    ctx.startActivity(iconintent);
                }
                else if(clickedString.charAt(0)=='h')
                {
                    linkselected=true;
                    childSelected=true;
                    Intent iconintent = new Intent(ctx, ShowLink.class);
                    iconintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    iconintent.putExtra("url","http://www."+dpurlentities[pos]);
                    ctx.startActivity(iconintent);
    
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I follow this tutorial for install omniauth in devise+mongoid: https://github.com/fertapric/rails3-mongoid-devise-omniauth/wiki/OmniAuth-Installation-Tutorial I have devise 1.4.5
I follow this tutorial to create a svn http://www.guyrutenberg.com/2007/10/29/creating-local-svn-repository-home-repository/ However after running $ svn
I follow this tutorial to learn some REST services and AJAX calls: http://www.mkyong.com/webservices/jax-rs/integrate-jackson-with-resteasy/ I
Follow up to this question . I have the following code: string[] names =
Follow up to this question about GNU make : I've got a directory, flac
Follow up to this question for Facebook Friends.getAppUsers using Graph API that pulls friends
I follow this rule but some of my colleagues disagree with it and argue
[a follow up to this question ] class A { public: A() {cout<<A Construction
Follow up to this question This (similar version from old link) works in SQL
Follow-up to post: Using * Width & Precision Specifiers With boost::format I'm trying to

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.