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

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 : 
The Main.xml file : 
The Stations.xml file : 


Other Threads

1. Wanted: Info & samples related to Android Developer Console changes

What is a eature graphic Could anyone provide an example? Is it
equired(the console doesn't seem to require it). Also, are "alphachannels allowed in the high resolution icon? Many icons have
transparent backgrounds. If you don't allow alpha channels in PNG
icons, what should we set the background to?


2. Bad image quality in canvas

Bitmap (or drawable) quality is bad when I draw it into canvas.
Gradient isn't smooth and lines have a little blur. I want to have a
hard lines.
What is the problem?

I'm testing the app on HTC Desire.
All pictures in png format.

Thank you.


3. Market statistics stall

4. Actual Galaxy Tab Displays Different Than Emulator - 5x5 Widgets?

5. Detecting changes in maps

6. Scroll View

7. Hello World doesn't work