0

I am trying to make my app searchable, according to this documentation. However, it does not work.

I tried the sample app (which is the source of the code in the documentation) and it works just fine. But when I tried to create a simple app from scratch using the tutorial, I was not able to get it to work.

I have browsed the most popular answers on SO, including this one and this one. Still no luck :-(

There is this part in the Manifest.xml of the sample that looks a bit suspicious

<path-permission 
    android:pathPrefix="/search" 
    android:readPermission="android.permission.GLOBAL_SEARCH" />

but I am not sure what to make of it...

Does anybody have experience with this? Is there some super-common pitfall I could be falling into?

Kelevandos
  • 7,024
  • 2
  • 29
  • 46

1 Answers1

1

Ok, this was REALLY annoying to track...

I created my ContentProvider implementation in Kotlin, instead of Java. Turns out that if I run the very same logic written in Java, it works perfectly fine.

I have no time or will to go into the details, but I would guess that one of the overriden methods has a non-null param, gets a null there form the system, an exception gets thrown and the ContentProvider is silently killed.

So if you your ContentProvider is in Kotlin and does not work, convert it to Java and try again.

Kelevandos
  • 7,024
  • 2
  • 29
  • 46