[android-developers] Re: ContentProvider.query() is not being called.
ping, not seen any comments on this...
On Oct 11, 8:07 am, sdphil <phil.pellouch...@gmail.com> wrote:
> I have been playing around with the SearchableDictionary sample
> application trying to understand it.
>
> I set a breakpoint in DictionaryProvider.query() and verified that
> it's going in there when I turn on search for this application
> (settings > search > searchable items > Searchable Dictionary).
>
> Then I tried modifying the AndroidManifest.xml file, changing the
> launch activity to .WordActivity --
> <!-- The default activity of the app. Can also display search
> results. -->
> <activity android:name=".SearchableDictionary"
> android:theme="@android:style/Theme.NoTitleBar">
>
> </activity>
>
> <!-- Displays the definition of a word. -->
> <activity android:name=".WordActivity"
> android:label="@string/app_name"
> android:theme="@android:style/Theme.NoTitleBar">
>
> <intent-filter>
> <action android:name="android.intent.action.MAIN" />
> <category
> android:name="android.intent.category.LAUNCHER" />
> </intent-filter>
>
> <!-- Receives the search request. -->
> <intent-filter>
> <action android:name="android.intent.action.SEARCH" />
> <category
> android:name="android.intent.category.DEFAULT" />
> </intent-filter>
>
> <!-- Points to searchable meta data. -->
> <meta-data android:name="android.app.searchable"
> android:resource="@xml/searchable"/>
>
> </activity>
>
> I also had to change WordActivity so it would startup (albeit not be
> useful) --
>
> // Intent intent = getIntent();
> //
> // String word = intent.getStringExtra("word");
> // String definition = intent.getStringExtra("definition");
> String word = "word";
> String definition = "definition";
>
> My expectation was that when I ran it and typed something in the QSB
> (search box on the main android page), it would still trigger the
> breakpoint. It's like it doesn't even recognize that the app should
> be part of the search anymore. I try moving the manifest changes back
> and it goes back to working.
>
> The thing that led me down this path was that I am trying to write my
> own ContentProvider, and I can't get the QSB to call my query method.
> So what gives with this sample code here? What is preventing (or
> enabling) query() to be called from the QSB?
>
> tia.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home