I have a layout that creates a ListActivity. Before displaying the ListActivity, I perform a database query, and then hook that data up to the List using a SimpleCursorAdapter.
All of this works fine on 1.6 and higher. On 1.5, the my function that performs the query successfully executes, but then a few seconds later a StackOverflowError takes place. Does anyone know why this error would occur in 1.5 but not in 1.6?
UPDATE: I have determined that the crash occurs when I move from an Activity with a TabView to an Activity with the ListView. If I go to the ListView from an Activity that does not contain a Tab View, then the crash does not occur. The activity with the ListView is returning a Cursor to a query where the database has about 10 columns. Of those 10 columns, I display 3 columns on the screen.
Here is the flow of execution for my code:
TabView Activity sends Intent to start List View Activity
onCreate() //of ListActivity
{
showList();
}
showList()
{
//open DataBase
//perform query
//create SimpleCursorAdapter
//setListAdapter
}
So for example, this runs completely fine on a Droid with 2.1 installed and on an emulator targeting 1.6. But the above fails on the HTC Hero with 1.5 and on an emulator targeting 1.5.
The crash happens if I let setListAdapter execute. If that line is out, everything works, but obviously my data does not get shown. It doesn't crash on the line that calls setListAdapter, but it'll eventually crash if setListAdapter is ever executed.
Stack Trace:
Thread [<3> main] (Suspended (exception StackOverflowError))
ViewRoot.draw(boolean) line: 1235
ViewRoot.performTraversals() line: 1030
ViewRoot.handleMessage(Message) line: 1482
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3948
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 782
ZygoteInit.main(String[]) line: 540
NativeStart.main(String[]) line: not available [native method]