Bonjour,
J'ai eu un problème lors du démarrage d'un "activity".
Sur l'activity A, quand on clique sur le bouton, je veux démarrer un autre activity.
Voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
((Button)findViewById(R.id.mdp_ok)).setOnClickListener(
	    		  new OnClickListener(){
	    			  public void onClick(View v) {
	    				  EditText mdp_text = ((EditText)findViewById(R.id.mdp_ET));
	    				  String mdp_str = mdp_text.getText().toString();
	    				  /*
	    				  Intent returnIntent = new Intent();
	    				  returnIntent.putExtra("return", "ok");
	    			      setResult(RESULT_OK,returnIntent);     */
	    				  Intent load_cards = new Intent(Connexion.this, Load_cards.class);
	    				  ((Button)findViewById(R.id.mdp_ok)).setOnClickListener(
	    		  new OnClickListener(){
	    			  public void onClick(View v) {
	    				  EditText mdp_text = ((EditText)findViewById(R.id.mdp_ET));
	    				  String mdp_str = mdp_text.getText().toString();
	    				  /*
	    				  Intent returnIntent = new Intent();
	    				  returnIntent.putExtra("return", "ok");
	    			      setResult(RESULT_OK,returnIntent);     */
	    				  Intent load_cards = new Intent(Connexion.this, Load_cards.class);
	    				  load_cards.putExtra("card_name",card_name);
	    				  load_cards.putExtra("id", (String) getIntent().getExtras().get("id"));
	    				  load_cards.putExtra("claim", (String) getIntent().getExtras().get("claim"));
	    				  finish();
	    				  startActivity(load_cards);
 
 
	    			  }
	      });
	    				  finish();
	    				  startActivity(load_cards);
 
 
	    			  }
	      });
Le problème est que le 2ème activity d'affiche pas tout de suite (Il s'éxcute en derrière plan). L'affichage du premier activity reste longtemp sur l'écran.

Quel qu'un a une idée?

Merci !