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.

pas de setcontentview... Comment je fais pour ajouter une vue ?

Featured Replies

Posté(e)

Bonjour,

Voila j'ai un problème qui je pense est simple mais que je n'arrive pas à résoudre car ne sachant pas vraiment par où chercher :rolleyes:

Dans le code qui suis, que j'ai réalisé à partir d'un code fournis par apiDemo, je voudrais ajouter une vue mais n'y arrive pas! Quelqu'un aurait une solution?

package fr.letroll.mesmangas;

import android.app.ExpandableListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.Toast;

public class Main extends ExpandableListActivity{

   ExpandableListAdapter mAdapter;
   ExpandableListView eXpd;
   Context context;
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       context=this.getBaseContext();
       // Set up our adapter
       mAdapter = new MyExpandableListAdapter(context);
       setListAdapter(mAdapter);

       registerForContextMenu(getExpandableListView());
       getExpandableListView().setOnChildClickListener(new OnChildClickListener() {
       	public boolean onChildClick(ExpandableListView expandableListView, View view, int groupPosition, int childPosition, long id) {

       	String nickName = (String) expandableListView.getExpandableListAdapter().getChild(groupPosition, childPosition);
       	Toast.makeText(context, nickName, Toast.LENGTH_SHORT).show();
       	if(groupPosition == 0) {
       	} 

       	return false;
       	}
       }); 
   }
}

Posté(e)

Ajouter un bouton par programmation dans ton ihm ? oui, c'est possible

Comment l'ajouter ? Cela dépend de où tu veux l'ajouter... Mais, en général, une vue qui permet de se voir ajouter des éléments fils (vues de type Layout) possède des méthodes du style addView qui permettent de faire cela...

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.