Mon problème est le suivant :

J'ai un menu à onglets avec 3 onglets. Dans l'onglet n°2 j'appuie sur un bouton, lors de l'appui je souhaite mettre à jour une list view dans l'onglet n°1. Seulement je bloque, il me jette à chaque fois, voici le log d'erreur :

02-23 14:53:22.837: E/AndroidRuntime(1183): FATAL EXCEPTION: main
02-23 14:53:22.837: E/AndroidRuntime(1183): Process: com.example.onglets, PID: 1183
02-23 14:53:22.837: E/AndroidRuntime(1183): java.lang.IllegalStateException: Could not execute method of the activity
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.view.View$1.onClick(View.java:3823)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.view.View.performClick(View.java:4438)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.view.View$PerformClick.run(View.java:18422)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.os.Handler.handleCallback(Handler.java:733)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.os.Handler.dispatchMessage(Handler.java:95)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.os.Looper.loop(Looper.java:136)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at java.lang.reflect.Method.invokeNative(Native Method)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at java.lang.reflect.Method.invoke(Method.java:515)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at dalvik.system.NativeStart.main(Native Method)
02-23 14:53:22.837: E/AndroidRuntime(1183): Caused by: java.lang.reflect.InvocationTargetException
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at java.lang.reflect.Method.invokeNative(Native Method)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at java.lang.reflect.Method.invoke(Method.java:515)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.view.View$1.onClick(View.java:3818)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	... 11 more
02-23 14:53:22.837: E/AndroidRuntime(1183): Caused by: java.lang.IllegalStateException: System services not available to Activities before onCreate()
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.app.Activity.getSystemService(Activity.java:4532)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at android.widget.SimpleAdapter.<init>(SimpleAdapter.java:85)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at com.example.onglets.Tab1.populateListView(Tab1.java:81)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	at com.example.onglets.Tab2.Alimentation_click(Tab2.java:44)
02-23 14:53:22.837: E/AndroidRuntime(1183): 	... 14 more
Tab1.java :

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
public class Tab1 extends Activity {
    /** Called when the activity is first created. */

	@Override
    public void onCreate(Bundle savedInstanceState) {
    
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.tab1);
        
        
        populateListView("lol", "5000 €");

       
        
        registerClickCallBack();
        
    
     
    }
	
	//TextView cat = new TextView(getBaseContext());
ArrayList<HashMap<String, String>> listItem = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
    
    public void populateListView(String poste, String montant) {
		// Création des noms à ajouter dans la listView

    	 
    	//Création d'une HashMap pour insérer les informations du premier item de notre listView
         map = new HashMap<String, String>();
         //on insère un élément titre que l'on récupérera dans le textView titre créé dans le fichier affichageitem.xml
         map.put("titre", poste);
         //on insère un élément description que l'on récupérera dans le textView description créé dans le fichier affichageitem.xml
         map.put("description", montant);
         //on insère la référence à l'image (convertit en String car normalement c'est un int) que l'on récupérera dans l'imageView créé dans le fichier affichageitem.xml
         map.put("img", String.valueOf(R.drawable.fleche));
         //enfin on ajoute cette hashMap dans la arrayList
         listItem.add(map);

         
       //Création d'un SimpleAdapter qui se chargera de mettre les items présent dans notre list (listItem) dans la vue affichageitem
         SimpleAdapter mSchedule = new SimpleAdapter (Tab1.this, listItem, R.layout.data_item, Ligne 81
         new String[] {"img", "titre", "description"}, new int[] {R.id.img, R.id.titre, R.id.description});
         ListView list = (ListView) findViewById(R.id.listView1);
         //On attribut à notre listView l'adapter que l'on vient de créer
         list.setAdapter(mSchedule);
    	 //List<E_S> values = bdd.selectionnerAll();
        
		
		//ArrayAdapter<E_S> adapter = new ArrayAdapter<E_S>( this, R.layout.data_item, values);
		//ListView list = (ListView) findViewById(R.id.listView1);
		//list.setAdapter(adapter);
		
	}
        
    	
    	public void registerClickCallBack() {
    		ListView list = (ListView) findViewById(R.id.listView1);
    		list.setOnItemClickListener(new AdapterView.OnItemClickListener(){

    			@Override
    			public void onItemClick(AdapterView<?> parent, View viewClicked, int position, long id) {
    			TextView textView = (TextView) viewClicked; 
    			String message = textView.getText().toString(); 
    			Toast.makeText(Tab1.this, message, Toast.LENGTH_LONG).show();
    			}	
    		});
    				
    			}

}
Tab2.java :

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
public class Tab2 extends Activity {
    /** Called when the activity is first created. */
	
	Tab1 t = new Tab1();
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab2);
    }
    
    
    public void Alimentation_click (View v){
    	
   	
    	t.populateListView("ok2", "50 €"); Ligne 44
    	
		    	
    	}
    
	
}
Merci pour votre aide