pommedure Posted April 14, 2011 Share Posted April 14, 2011 Bonsoir a tous/toutes ! Voila, j'ai un petit soucis. Je me situe sur un layout que j'ai crée, j'y affiche un TextView suivi d'un bouton. J'aimerais, que lorsque je clique sur le bouton, ce TextView affiche une autre valeur, comme "Joueur2" sans changer de layout. Est-ce possible, si oui pourriez vous m'aider ? Merci a tous :lol: Link to comment Share on other sites More sharing options...
guigs06 Posted April 15, 2011 Share Posted April 15, 2011 Bonjour, Oui biensur, il suffit d'implémenter la méthode OnClick(View v) de l'interface OnClickListener et de lui dire que ton textView prendra telle valeur lors du click à l'aide de : tonTextView = (TextView)findViewById(R.id.tonTextView); tonTextView.setText("hello"); Link to comment Share on other sites More sharing options...
pommedure Posted April 15, 2011 Author Share Posted April 15, 2011 Ah oui, merci cela fonctionne ! :emo_im_angel: Maintenant que je vois le code, je me demande pourquoi je n'y avait pas pensé plus tot :| Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.