Pierre87 Posted April 30, 2010 Share Posted April 30, 2010 J'essaye de faire une TextView où une partie du texte est cliquable SpannableString s = new SpannableString("azerty"); s.setSpan(new ClickableSpan() { public void onClick(View widget) { System.out.println("lol"); } }, 0, 6, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); TextView tooltip = (TextView) this.findViewById(R.id.tooltip); tooltip.setText(s); marche pas :( j'ai zappé un truc ? merci Link to comment Share on other sites More sharing options...
Guest Posted May 11, 2010 Share Posted May 11, 2010 Pourquoi juste une partie du texte ? Si tu veux vraiment faire ça, tu n'as qu'a juste séparé ta phrase où je sais pas quoi en deux/trois/quatres textview différentes. Après tu fais comme pour les boutons : final TextView tv = (TextView)findViewById(R.id.mailtv); tv.setOnClickListener(new OnClickListener(){ public void onClick(View v ){ // Ton action } }); Link to comment Share on other sites More sharing options...
Pierre87 Posted May 16, 2010 Author Share Posted May 16, 2010 ouais .... je sais pas si c'est élégant, et si ça marche avec les sauts de ligne ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.