Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TextView, clickable, span

Featured Replies

Posté(e)

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

  • 2 weeks later...
Posté(e)

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

           }
           });

Posté(e)
  • Auteur

ouais ....

je sais pas si c'est élégant, et si ça marche avec les sauts de ligne ...

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.