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]Aide pour un prof

Featured Replies

Posté(e)

Salut, je suis un prof du quebec qui a fait une petit appli pour son ecole, elle fonctionne bien mais je voudrais pouvoir implementer une fonctionnalité simple que je n'arrive pas a faire étant nouveau dans ce domaine. Voici mon script, je veux juste reussir a prendre le courriel de l'item de la liste et l'im^plementer dans mon intent qui ouvre le service email du client avec la methode putExtra. J'aimerai savoir comment aller chercher le data courriel pour qu'il s'inscrivent dans l'adresse email quand un parent ou eleve click sur le nom de la liste. J'ai mis un bout de mon script qui montre comment je met mes 80 profs dans une liste avec hashmap. Si ya des personnes pour aider un neophite de la programation, je vous en remercie d'avance.

Frank

map = new HashMap<String, String>();

map.put("titre", "Francois Groulx");

map.put("description", "Univers Social");

map.put("courriel", "francois.groulx@cspi.qc.ca");

map.put("img", String.valueOf(R.drawable.ic_launcher_contacts));

listItem.add(map);

SimpleAdapter mSchedule = new SimpleAdapter (this.getBaseContext(), listItem, R.layout.liste_direction,

new String[] {"img", "titre", "description", "courriel"}, new int[] {R.id.img, R.id.titre, R.id.description, R.id.courriel});

maListViewPerso.setAdapter(mSchedule);

maListViewPerso.setOnItemClickListener(new OnItemClickListener()

{

@Override

public void onItemClick(AdapterView<?> parent, View v,

int position, long id)

{

HashMap<String, String> map2 = (HashMap<String, String>) parent.getAdapter().getItem(position);

String email2 = map2.get("courriel");

Intent emailIntent = new Intent(Intent.ACTION_SEND);

// The intent does not have a URI, so declare the "text/plain" MIME type

emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);

emailIntent.putExtra(Intent.EXTRA_EMAIL,new String[] {email2});

startActivity(emailIntent);

}

});

Modifié par Farfelufrank

Posté(e)

Pour récupèrer la sélection c'est simple, dans la méthode onItemClick de ton listener tu as accès à l'élément où tu cliques de cette façon :

	 HashMap<String, String> map = (HashMap<String, String>) parent.getAdapter().getItem(position);
 String email = map.get("courriel");

Voila, bonne continuation :)

Modifié par djeman

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.