Bonjour,
Etant en essayant de creer une TabHost j'obtiens ce message d'erreur, mais je n'arrive pas a le regler:
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part A11-26 17:44:05.416: E/AndroidRuntime(2655): java.lang.RuntimeException: Unable to start activity ComponentInfo{package/package.Main}: java.lang.RuntimeException: Unable to start activity ComponentInfo{package/package.Agenda}: java.lang.NullPointerException
Voila si quelqu'un a une idee! Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 TabHost tabHost = getTabHost(); tabHost.setOnTabChangedListener(this); final TabSpec tabAgenda = tabHost.newTabSpec("Agenda").setIndicator("AGENDA").setContent(new Intent(this, Agenda.class)); final TabSpec tabPodcast = tabHost.newTabSpec("Podcast").setIndicator("PODCAST").setContent(new Intent(this, Song.class)); final TabSpec tabMap = tabHost.newTabSpec("Map").setIndicator("MAP").setContent(new Intent(this, Apropos.class)); final TabSpec tabContact = tabHost.newTabSpec("Contact").setIndicator("CONTACT").setContent(new Intent(this, Contact.class)); tabHost.addTab(tabAgenda); // FORCE CLOSE HERE tabHost.addTab(tabPodcast); tabHost.addTab(tabMap); tabHost.addTab(tabContact);
Partager