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]Rafraichissement ImageButton

Featured Replies

Posté(e)

Bonjour, la page d'accueil de mon appli se compose de deux imagebutton sauf que ces imagebutton ne s'affichent pas de suite, il faut d'abord cliquer sur le button puis retour à la vue précédente et là mon imageButton sur le quel j'ai cliqué s'affiche normalement...  

public class MainActivity extends Activity {

    ImageButton imageButton;
    ImageButton imageButton2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acceuil);

        addListenerOnButton();


    }

    public void addListenerOnButton() {

        imageButton = (ImageButton) findViewById(R.id.imagePs3);
        imageButton2 = (ImageButton) findViewById(R.id.imageXbox);

        imageButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {

        
                imageButton.setBackgroundResource(R.drawable.ps3);
                Intent intent = new Intent(MainActivity.this, AcceuilPs3.class);
                startActivity(intent);

            }

        });

        imageButton2 = (ImageButton) findViewById(R.id.imageXbox);

        imageButton2.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {

                imageButton2.setImageResource(R.drawable.xbox);
                Intent intent = new Intent(MainActivity.this, AcceuilXbox.class);
                startActivity(intent);

            }

        });


    }

}

Déjà je ne comprends pas pourquoi je n'arrive pas à tout simplement faire un android:src( ou background)="@drawable/ps3" j'ai une erreur rendering "failed to convert @drawable/ps3 into a drawable"

 

 

 

EDIT : A supprimé , ou pour ceux à qui ça arrive, aucun png ne peux etre converti en drawable , juste redemarrer l'IDE ( android studio pour moi ) ... --> 1h de perdu quand même ^^'

 

 

 

Merci d'avance.

Modifié par gogui63

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.