[android-developers] Search action not working

2012-04-10 Thread Dwayne Boulden
Hello friends.  I've hit a brick wall, and cannot seem to get past it. 

I have a very simple app with one activity. I want to include search, but 
withing the same activity (I simply pass the search qry on to a webview and 
the external website does the rest. )

Here is the Manifest snippet:
activity
android:name=.SkBooks1Activity
android:label=@string/app_name 
android:windowSoftInputMode=stateHidden
intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /
/intent-filter
intent-filter
action android:name=android.intent.action.SEARCH / 

/intent-filter
meta-data android:name=android.app.searchable
android:resource=@xml/searchable/
/activity

And here is my activity code:

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//declare variable
   ...

// Get the intent, verify the action and get the query
Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
  String query = intent.getStringExtra(SearchManager.QUERY);
  doMySearch(query);
}

After the search launches, I type something, and press enter and the screen 
reloads (like it is reloading the activity) but the doMySearch is not being 
called. Any ideas? 

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Search action not working

2012-04-10 Thread TreKing
On Thu, Apr 5, 2012 at 11:55 PM, Dwayne Boulden dwayne...@gmail.com wrote:

 Any ideas?


Debug your code. Use LogCat. Use your debugger. Get more information then
provide that here if you're still stuck.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en