Your guess makes sense and was totally correct. Thanks very much!
I removed the the static String / third parameter from the constructor
(now using the context and textViewResourceId only constructor), and
added some test-entries using the add("String")-method instead. After
that it was possible to use the clear()-method and then re-populate
the list again.
Question though: When going back to the old (failing) solution, the
debugger stops (of course) but says "Source not found" and shows an
"Edit Source Lookup Path..."-button.
Is this the normal behaviour when halting in debug mode? Is my Eclipse/
SDK installation not correctly Setup?
Thanks!
On 12 Juni, 01:41, Mark Murphy <[email protected]> wrote:
> Andy_Sthml wrote:
> > My problem is probably very simple, but I can't find out why the below
> > code fails (at the "arrayAdapter1.clear()".
>
> > Background : My class extends Activity (which is started from a
> > buttonclick in the Main activity) and displays 2 buttons and a
> > listview. When onCreate, the listview is filled with countries. This
> > works.
> > When pressing one of the buttons I want to modify (clear) the list.
> > Here the program stops unexpectedly. Any idea?
>
> What does the exception and stack trace indicate? You can get this
> through adb logcat, DDMS, or the DDMS perspective in Eclipse.
>
> If I had to guess, ArrayAdapter#clear() may not work when you initialize
> it with a static String array, but that's just a guess.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO!http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---