djdamage Posted March 17, 2010 Share Posted March 17, 2010 Bonjour à tous, En voyant le code ci-dessous vous allez rapidement comprendre : switcher.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (v == switcher) { Intent intent = new Intent(Tut.this, Tut2.class); switcher.setColorFilter(0x77000000, Mode.SRC_ATOP); startActivity(intent); } } }); Lorsque je clique sur le 'switcher', il devient foncé et l'activité appelée se lance, de telle sorte à ce que l'utilisateur voit qu'il a bien appuyé... Or quand on appuie sur le bouton BACK du téléphone, ce filtre est maintenu sur le 'switcher'... Comment faire ? Merci d'avance pour vos réponses :) Quote Link to comment Share on other sites More sharing options...
Fluckysan Posted March 17, 2010 Share Posted March 17, 2010 Je n'ai pas très bien compris mais peut-être que tu devrais voir quand l'utilisateur appuie sur back (OnKeyListener) et agir en conséquence pour rétablir tes Views ? Quote Link to comment Share on other sites More sharing options...
Nivek Posted March 17, 2010 Share Posted March 17, 2010 A mon avis il faudrait plutôt jouer avec une définition xml du background en fonction du focus, comme l'a très bien expliqué Cyril Mottier : <?xml version="1.0" encoding="utf-8"?> Tout est merveilleusement détaillé là : http://android.cyrilmottier.com/?p=124 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.