Question

My application use standard search mechanism (using searchable interface) and works well in all versions>2.1

In <3 I use Search Dialog and in >=3 I use SearchWidget and all works correctly. The problem is in 2.1 where I get CrossProcessCursorException from my ContentProvider:

java.lang.UnsupportedOperationException: Only CrossProcessCursor cursors are supported across process for now

It seems that Search dialog is run in another process in 2.1? There's any way to workaround that? Or I'm forced to implement CrossProcessCursor in my custom extended CusorWrapper?

Was it helpful?

Solution

Finally I haven't found any information about why in Android 2.1 you need to use a CrossProcessCursor.

But looking at SearchDictionary samples for 2.1 it uses a MatrixCursor and for newer android versions it uses a direct cursor from DB. Then I assumed that you simply need it because it work in this way.

I've tried two alternatives that both works:

  1. Map the results with a MatrixCursor
  2. Implement a CrossProcessCursorWrapperCompat taking the code from CrossProcessCursorWrapper from newer versions and adapting it to work in 2.1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top