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. Dynamically loading a .jar file at Runtime

Also keep in mind that doing this kind of thing is completely insecure.  Any
app can go and modify your files on the sd card to insert their own code
into your app and run under your identity.  Then any malicious things they
do with your app's permissions are the fault of your app.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.


2. How to specify the length of the EditText in a Table row

I have a TableLayout with a couple of TableRows.  Inside a table row,
i have an EditText widget followed by a TextView widget.

How can I make sure that each widget in the row takes equal width?

3. SimpleCursorAdapter and setListAdapter problems

4. SimpleCursorAdapter Use

5. how to report gps sv status

6. Hidden Contacts

7. how to implement scrolling text?