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.

Listener sur une listeView

Featured Replies

Posté(e)

Bonjour ,je suis nouveau dans android et me voici sur le forum

pour une petite question :

je ne comprends pas pourquoi mon listener ne fonctionne pas

public void onCreatebis( ResolveInfo resolveInfo) {

setContentView(R.layout.main);

final Intent mainIntent=new Intent(Intent.ACTION_MAIN,null);

mainIntent.addCategory(Intent.CATEGORY_LAUNCHER) ;

final PackageManager pm = getApplicationContext().getPackageManager();

final ArrayList<ResolveInfo> listP= (ArrayList<ResolveInfo>) pm.queryIntentActivities( mainIntent, 0);

final int trimLength = "com.android.".length();

ArrayList<String> maliste = new ArrayList<String>();

Drawable iconApp;

// Loop over each item.

for (ResolveInfo info : listP) {

// Get the (full, qualified) package name.

String packag = info.activityInfo.applicationInfo.packageName;

// Now, trim it with substring and the trim length.

String trimmed = packag.substring(trimLength);

maliste.add(trimmed);

iconApp= info.activityInfo.loadIcon(getPackageManager());

}

ListView list = (ListView)findViewById(R.id.list);

monadaptateur adapter2 = new monadaptateur(this, maliste);

list.setAdapter(adapter2);

list.setOnItemClickListener(new OnItemClickListener(){

@Override

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,

long arg3) {

Log.v("lalalala","lalala");

}

});

}

Modifié par Bob.Nkusi.Pro@gmail.com

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.