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.

Type de caractère

Featured Replies

Posté(e)

Bonjour,

Pour une application, je récupère le texte d'un textview et je veux le comparer à 0. Je fais donc ça :

	TextView TexteEcran = (TextView)findViewById(R.id.TexteEcran);
	if (TexteEcran.getText()=="0") {
			TexteEcran.setText(Touche);
		}
		else {
			TexteEcran.setText(TexteEcran.getText() + Touche);
	}

Dans le déboggueur il m'indique que TexteEcran.getText() est égal à 0 mais le if ne marche jamais. Qqn à une piste.

Frk

Posté(e)

essai avec ça :

TextView texteEcran = (TextView)findViewById(R.id.TexteEcran);
 if (texteEcran.getText().toString().equals("0")) {
         texteEcran.setText(Touche);
  }
  else {
       texteEcran.setText(texteEcran.getText() + Touche);
 }

Pour la petite histoire quand tu fais if (TexteEcran.getText()=="0"), tu compares deux instances donc elle sont forcement différentes

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.