Activities and ListActivities with button and lists

by MyGB » Fri, 23 Apr 2010 08:05:42 GMT


Sponsored Links
 Hi everyone,
It's the first time I post here, so I hope I'll be clear for my
problem.

I'm developing a real-time informations about train. The application
will connect to a XML plateform that will give the next trains with a
station given.
I'm a beginner in Android development, and I'm stuck to a class-
problem (I think...).

In details, the problem is, when I start the application, the user get
a screen with 2 buttons, one of them get the user to a new screen with
stations list. But, my problem is, I can't put buttons and lists in
the same class.
I explain, to get a list on the screen, I have to put :
"public class NextTrain extends ListActivity {"
but the buttons function doesn't work (the app crashs).
By the way, if I put
"public class NextTrain extends Activity {"
the buttons works but not the list (no crash, but the screen doesn't
display anything).

Can you help me ?
Thanks in advance.

The Java source file :  http://pastebin.com/RwHyi299 
The Main.xml file :  http://pastebin.com/A1avkfZc 
The Stations.xml file :  http://pastebin.com/1firyRhB 

--