Question

i have two activities within an ActivityGroup, one "ProvinceActivity" and another "CityActivity". so code:

public class CityManagerActivity extends ActivityGroup {
    View v1 = getLocalActivityManager().startActivity(
                "tab1",
                new Intent(this, ProvinceActivity.class)
                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
                .getDecorView();
    replaceView(v1);
}

but when I have a default searchable by pressing search-key in the "tab1" the search i have the ERROR:

08-19 17:18:23.438: ERROR/AndroidRuntime(9078): Uncaught handler: thread main exiting due to uncaught exception 
08-19 17:18:23.458: ERROR/AndroidRuntime(9078): java.lang.IllegalArgumentException: no ident 
08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.ensureSearchManager(Activity.java:3499) 
08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.startSearch(Activity.java:2648) 
08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.onSearchRequested(Activity.java:2612) ...

the second search works,tell me how to do it,plz...

Was it helpful?

Solution

Have same problem. I use this and it fix the problem.

@Override
public boolean onSearchRequested() {
    return true;
}

OTHER TIPS

For others i think by just returning true the app shows an behavior which the user does not expect because it should show some kind of search and by returning true this is overridden.

The article http://www.app-solut.com/blog/2011/10/unexpected-behavior-when-working-with-nested-tabhosts/ shows a good way how to solve this problem in a TabHost without changing the default behavior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top