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.

RESOLU - Les listviews me rendront fou!

Featured Replies

Posté(e)

Salut à tous,

Dans mon appli, je fais une simple listview suivant cette methode:

setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, MA_LISTE));

Tout se passe tres bien et mon programme affiche bien une liste. C'est un bon début! :P

Le petit couac, c'est que sur chaque élément de ma liste, j'ai programmé un click long avec "monter" ou "descendre" pour que l'utilisateur puisse la trier suivant ses désirs.

Je recalcule donc MA_LISTE. ceci se fait sans soucis, et quand je refais ma commande setListAdapter, je pensais que ma liste allait se réactualiser.

Malheureusement, pour voir la réactualisation, il faut que je scrolle pour faire disparaitre les éléments, et au moment ou je reviens dessus, ils changent bien.

Comment pourrais-je faire un simple refresh? Suis je obligé de reconstruire mon programme ou puis-je m'en sortir avec une seule commande?

Merci!!!

Modifié par Profete162

Posté(e)

l'adapter a une méthode notifyDataSetChanged().....enfin peut etre pas les array adapter.....

Posté(e)
  • Auteur

il y a le mot invalidate qui fait bizarre dans une phrase en francais!

Je mets résolu dans mon titre, j'allais oublier...

Rejoignez la conversation

Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

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.