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 sans réaction

Featured Replies

Posté(e)

Bonjour,

je développe une petite appli pour android mais les listener ne font rien, mon code me parait pourtant correct :

public class Main extends Activity implements OnClickListener
{
private Button buttonD = null;
private Button buttonB = null;
private Button buttonH = null;

private EditText txtD = null;
private EditText txtB = null;
private EditText txtH = null;

public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

buttonD = (Button)findViewById(R.id.convertD);
buttonB = (Button)findViewById(R.id.convertB);
buttonH = (Button)findViewById(R.id.convertH);

txtD = (EditText)findViewById(R.id.decimal);
txtB = (EditText)findViewById(R.id.binary);
txtH = (EditText)findViewById(R.id.hexa);

buttonD.setOnClickListener(this);
buttonB.setOnClickListener(this);
buttonH.setOnClickListener(this);
}

public void onClick(View v)
{
switch(v.getId())
{
case R.id.convertD:
int valD = Integer.parseInt(txtD.getText().toString(),10);
txtB.setText(Integer.toBinaryString(valD));
txtH.setText(Integer.toHexString(valD));
break;

case R.id.convertB:
int valB = Integer.parseInt(txtB.getText().toString(),2);
txtD.setText(Integer.toString(valB));
txtH.setText(Integer.toHexString(valB));
break;

case R.id.convertH:
int valH = Integer.parseInt(txtH.getText().toString(),16);
txtD.setText(Integer.toString(valH));
txtB.setText(Integer.toBinaryString(valH));
break;
}
}
}

Lorsqu'on clic sur le bouton correspondant, les 2 autres EditText doivent être modifié et converti dans les bases 2/10/16 mais en testant avec l'émulateur, il ne se passe rien en cliquant sur un bouton. Si quelqu'un a une idée....

Posté(e)
  • Auteur

J'ai compris le problème, vu qu'il est étrange...

Si je ne fais pas un ant clean avant de recompiler, le .apk semble exactement le même après recompilation (même taille malgrès des modifications dans le .java et après avoir supprimer l'ancien) alors qu'aaprès un ant clean, la taille du apk change bien et mon programme fonctionne.....

Quelqu'un à une explication ?

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.