On Thu, Apr 22, 2010 at 10:51 AM, MyGB <[email protected]> wrote:
> I'm developing a real-time informations about train.
>
Cool, me too! Well, mostly buses, but same diff.
> But, my problem is, I can't put buttons and lists in the same class.
>
Sure you can.
> I explain, to get a list on the screen, I have to put : "public class
> NextTrain extends ListActivity {"
>
No, you don't HAVE to, but extending ListActivity does simplify things if
your activity is predominantly list-oriented.
> but the buttons function doesn't work (the app crashs).
>
Crashes HOW? We can't read your mind (or code).
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).
>
Did you actually add a ListView to the Activity?
> Can you help me ?
>
I can try.
If you extend ListActivity you can add a header view to your ListView
containing your two buttons.
Alternatively if you extend Activity, you can create a layout with your two
buttons and a ListView.
> Thanks in advance.
>
You're welcome in advance.
-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en