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 

--



Other Threads

1. Eric Schmidt: Android Momentum is Here

Momentum for Android is Here, Cell Phones subsidized, Prize is China

Eric Schmidt at Morgan Stanley Technology Conference
http://www.youtube.com/watch?v=PjDw3azfZWI

- Juan T.
--~--~---------~--~----~------------~-------~--~----~

2. Text writing pad

Hi All,
Do we have text writing pad in android like iPhone? If any possible
idea please give me your thoughts.

Thanks in Advance,
Muthu Kumar K.
--~--~---------~--~----~------------~-------~--~----~

3. Problem in setting empty views in a list

4. database not open error

5. Adding frame to an image

6. Question about Preference Screen

7. Spreadsheet-like Grid?