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. android.R.anim may not have all constants?

Hi.

I'm using android-sdk-windows-1.1_r1.

I saw in some examples that android.R.anim has a lot of constants,
such as slide_in_right and push_down_in. However, in my android.jar I
can only see:

  // Field descriptor #8 I
  public static final int accelerate_decelerate_interpolator =
17432580;

  // Field descriptor #8 I
  public static final int accelerate_interpolator = 17432581;

  // Field descriptor #8 I
  public static final int decelerate_interpolator = 17432582;

  // Field descriptor #8 I
  public static final int fade_in = 17432576;

  // Field descriptor #8 I
  public static final int fade_out = 17432577;

  // Field descriptor #8 I
  public static final int slide_in_left = 17432578;

  // Field descriptor #8 I
  public static final int slide_out_right = 17432579;

If this is correct, how can I create a slide_in_right animation using
AnimationUtils.loadAnimation?

Thank you!

--~--~---------~--~----~------------~-------~--~----~

2. Connect Android Dev Phone G1 to Ad Hoc Wifi Network

Does anyone know how to connect an Android G1 to an Ad Hoc Wifi
network running on a computer because the ad hoc network doesn't seem
to appear in the list of Wifi networks to connect to on the G1?

--~--~---------~--~----~------------~-------~--~----~

3. Is there anyway to intercept HTTP request in Android?

4. Android USB file transfer

5. Working through Notepad Tutorial - Problems...

6. ACTION_CALL how to get the called time in Activity Result

7. mapView drawing is slow