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.

[Résolu] Donner le focus à un EditView

Featured Replies

Posté(e)

Bonjour

J'aimerai donner le focus à un EditView en particulier dans mon layout (et en plus sélectionner l'intégralité du texte déjà saisi dans ce layout).

Est-ce que quelqu'un sait ce qu'il faut faire pour cela ?

Merci d'avance

Modifié par TsCyrille

Posté(e)
  • Auteur

Bonjour

En effet en utilisant la fonction requestFocus (puis en appelant la fonction selectAll pour tout sélectionner).

Merci pour ton aide

Modifié par TsCyrille

Posté(e)

si tu veux en plus déployer le clavier :

this.toto.onTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0));

this.toto.onTouchEvent(MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0));

Posté(e)
  • Auteur

Bonjour

Et si je veux au contraire fermer le clavier (par exemple au moment du click sur un Button) : comment faire ?

Posté(e)
  • Auteur

J'ai trouvé en utilisant ce code :

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

Modifié par TsCyrille

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.