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. Incident with HTC Desire (Android Froyo)


I am wondering anyone ever experienced this incident. I am using HTC
Desire with froyo installed. Then i happent that my phone crash. Even
i tried to turn off and turn on again,  error dialog keep showing up,
and crash again.

As I remember, I was running 2 new installed app at the same time
before that crash happen, so not use which app caused it. The 2 apps
are skype, and funambol. I suspect funambol.

I tried to when i run funambol and its asked me to import contact,
then I just run it. there are like 1000 contacts to be imported, and
it took around 30 minutes to complete. And short after that, i got
error said phone memory low. I closed the app, and deleted all my
phone contacts and apps, and freed up 5 mb. But shortly , without even
running the app again, I got the error again said phone memory low. I
checked the memory, and the 5 mb gone! .

I got a chance to check on Settings->application, which app took most
of memory. I saw contacts storage took 35mb, don't know whether it is
normal. Then shortly it keep showing dialog, phone memory low, and
forcing all apps to close and got a lot errors dialog. Restart the
phone doesn't help, even removing the battery when restarting doesn't

Seems need to flashing the flash memory and reinstall android and lost
all my data. Quite terrible experience since I use android phone 2
weeks ago.


2. Am I being banned

I can't see my posts for the last month or so.
am I being banned?



3. To finish() an "Activity" ?

4. uses of inten-filter and bindservice

5. How to extend intent

6. two lines in a row list view

7. should i use a service or local thread ?