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 


Other Threads

1. Code compiled with SDK 2.0 does not install (and therefore run) on 1.5 emulator

I did signed export of the package while setting the target as 2.0.
Then I tried to install the package by downloading it *through
browser* (OTA download) on all the emulators. On 1.5, when I click on
the download in order to install the package, I get the

"Parse Error: There is a problem parsing the package"

It works on 1.6 and 2.0 though.

Compiling with 1.6 set as the target seems to install on all the
emulators ok.

Is it zipalign issue? Or if not - can someone clarify that to me? For
now I don't use any 2.0 APIs, so I can just use 1.6 but in future -
who knows and if this is going to be still a problem, how should be go
about backward compatibility?



2. ListActivity, cursor requerying, and view collision

I have a ListActivity that uses a managed cursor. Each row in the list
has buttons, and clicking on some of the buttons causes an update to
the db; I subsequently call requery on the cursor.

The updates are sometimes happening on 2 rows instead of 1. For
example, the pressed button state shows both for the pressed button
and a button on another row (a fraction of a second later). In my
ViewBinder's setViewValue method, I can see that the button views are
getting recycled and reused in reverse order through LogCat:

... android.widget.imagebut...@437a0288
... android.widget.imagebut...@43799318
... android.widget.imagebut...@43791d60
... android.widget.imagebut...@437832c8
... android.widget.imagebut...@437832c8
... android.widget.imagebut...@43791d60
... android.widget.imagebut...@43799318
... android.widget.imagebut...@437a0288

It isn't only the button states that are getting mixed up - I also
have text views and progress bars that are sometimes getting updated
with another row's data.

Is there some trick to prevent this from happening?

Thanks in advance,


3. apps2sd di tommy-dwang11

4. ListView problem is back.

5. Broadcast receiver

6. What is you Qustion?

7. BAck to Activity after WebView