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.

boutton

Featured Replies

Posté(e)

salut tt le mnde j'ai un grand souci mais je me suis coincé alr mn prb c ke jai deux boutton dans une activité et je veux ke lorsque jappui sur le premier j'aurai un sons 1 et sur le 2eme un sons 2 voila mon code:

package com.lstner;

import android.app.Activity;

import android.media.MediaPlayer;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.view.KeyEvent;

import android.util.Log;

public class lstner extends Activity implements View.OnClickListener {

Button myToastButton;

/* Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

myToastButton = (Button)findViewById(R.id.boutonToast);

myToastButton.setOnClickListener(this);

}

/* Called when a click is detected on a view. */

@Override

public void onClick(View view) {

MediaPlayer mp= MediaPlayer.create(this, R.raw.mlm);

mp.start( );

}

//fermer une application par le boutton revenir

@Override

public boolean onKeyDown(int keyCode, KeyEvent event)

{

switch(keyCode){

case KeyEvent.KEYCODE_BACK :// faire rien ;

Log.i("BTN", "backpressed: System.exit(0)");

System.exit(0);

}

return false;

}

}

merci d'avoir m'aider :)

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.