Activities and ListActivities with button and lists

by ~ TreKing » Fri, 23 Apr 2010 10:37:21 GMT


Sponsored Links
 



Cool, me too! Well, mostly buses, but same diff.



Sure you can.



No, you don't HAVE to, but extending ListActivity does simplify things if
your activity is predominantly list-oriented.



Crashes HOW? We can't read your mind (or code).

 By the way, if I put
"public class NextTrain extends Activity {"

Did you actually add a ListView to the Activity?



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.



You're welcome in advance.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--



Other Threads

1. Troubles with hierarchyviewer

Hi,

I can't figure out how to acces to the view hierarchy through
hierarchyviewer :

- my device (tests with NexusOne/Froyo and Galaxy/Cupcake) is
connected,
- I start hierarchyviewer, I select my device in the "device panel",
- And when I press start the terminal dispalys :

protocol = 2
version = 2

but nothing else appends.

"Stop Servers", "Refresh Windows", "Devices" and "Load View Hierarchy"
buttons remains unavailable.
Did i do smthg wrong ?

Thanx.

Tom.

-- 

2. TaskAffinity causes new instance being created when startActivity

Hi,
I have a problem about taskAffinity of Activity.
Activities A and B with the same taskAffinity.

A starts B with FLAG_ACTIVITY_NEW_TASK and the B starts A with
FLAG_ACTIVITY_NEW_TASK again.
Dumpsys activity of system gives us task stack like below:

TOP-> A
          B
          A

According to SDK's reference to FLAG_ACTIVITY_NEW_TASK, the result is
supposed to be like below:
TOP -> A
           B

If we did not set taskAffinity, A will not be created again but in
different task stack from B. (A and B are in different Apps)

After a little more research, we found FLAG_ACTIVITY_REORDER_TO_FRONT
is what we want.

My question is whether SDK' reference to FLAG_ACTIVITY_NEW_TASK is
wrong?

Thanks,

James

-- 

3. How to lanuch test application from phone

4. How to find memory leak?

5. How to select multi phone number from phone book?

6. Is it possible to use the USB connection in my app?

7. Regarding email and phone number from contact