Dear All, I'm trying to program Search Dialog by follow instruction in Android.com website However, Search Dialog never appear and Search Activity never created, so Anyone have experience please give me a hand.
//------------------------------------------------------------------------------------------------------// Here is the code from AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Test.TestSearch" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Main" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="SearchActivity"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity> <meta-data android:name="android.app.default_searchable" android:value="SearchActivity" /> </application> <uses-sdk android:minSdkVersion="7" /> </manifest> //----------------------------------------------------------------------------------------------------------// Code from xml/searchable.xml <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:hint="Test Search Hint" android:label="Test Search"> </searchable> //---------------------------------------------------------------------------------------------------------// Code from Main.java public class Main extends Activity implements OnClickListener { /** Called when the activity is first created. */ private Button searchButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); searchButton = (Button) this.findViewById(R.id.SearchButton); searchButton.setOnClickListener(this); } @Override public void onClick(View view) { Log.d("Main", "Clicked"); onSearchRequested(); } } //------------------------------------------------------------------------------------------------// Code from SearchActivity.java public class SearchActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Intent queryIntent = getIntent(); final String queryAction = queryIntent.getAction(); if (Intent.ACTION_SEARCH.equals(queryAction)) { Log.d("SearchActivity", "Search Invoke"); String searchKeywords = queryIntent.getStringExtra(SearchManager.QUERY); } } } //---------------------------------------------------------------------------------------------// Thank you for your help Best Regards, Chet Chetchaiyan -- 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