0

How I can get cursor related to other app db. I don't wanna use searchView or start another activity for get result of search. I should get cursor from SeachManager or PackageManager.GET_PROVIDERS (or third solution)?

sergii.gudym
  • 163
  • 1
  • 13
  • what do you mean by `"another app"`? if you want a `Cursor` so maybe you mean a custom `ContentProvider` that is implemented by that `another app`? if so, see `ContentResolver#query()` method – pskink Sep 16 '18 at 09:04
  • @pskink https://developer.android.com/training/tv/discovery/searchable i wanna read data which provided by this mechanism – sergii.gudym Sep 16 '18 at 10:38
  • and whats unclear in the guide you linked? – pskink Sep 16 '18 at 10:43
  • @pskink in this guide provided information about "how put data" , I wanna know how it get – sergii.gudym Sep 16 '18 at 11:37
  • doesnt the first paragraph say that? *"Android TV uses the Android [search interface](https://developer.android.com/guide/topics/search/index.html) to retrieve content data from installed apps and deliver search results to the user. Your app's content data can be included with these results, to give the user instant access to the content in your app."* – pskink Sep 16 '18 at 11:41
  • @pskink This mechanism is needed for Android tv but does not mean that I can not read this data. – sergii.gudym Sep 16 '18 at 11:57
  • i have no idea what you mean, sorry – pskink Sep 16 '18 at 11:57
  • @pskink I decompiled code of katniss, but it obfuscated, and need many time for understand it. They use standard mechanisms FE:ContentProviderClient acquireUnstableContentProviderClient = context.getContentResolver().acquireUnstableContentProviderClient(build); pair = Pair.create(acquireUnstableContentProviderClient.query(build, null, suggestSelection, strArr, null, null), acquireUnstableContentProviderClient); Cursor cursor = (Cursor) pair.first; – sergii.gudym Sep 16 '18 at 12:01
  • I have all methods , but no have any documentation how use they. fe2: List searchablesInGlobalSearch = ((SearchManager) this.f3422a.f3408a.getSystemService("search")).getSearchablesInGlobalSearch(); – sergii.gudym Sep 16 '18 at 12:04

0 Answers0