views:

19

answers:

0

Hi,

Does anybody knows how to set android search dialog hint dynamically? T have try to do something like:

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
 android:label="@string/search_label"
 android:hint="@string/search_hint"
 android:id="@+id/search_dialog_text">
</searchable>

Somewhere:

@Override
public boolean onSearchRequested() {
  Bundle appSearchData = new Bundle();
  appSearchData.putString("SomeSpecificParam", SomeClass.class.getName());
  startSearch("", false, appSearchData, false);
  EditText  text = (EditText )findViewById(R.id.search_dialog_text);
  text.setHint("Search something else");
  return true;
}

but text is equal null.

So looking forward you suggestions. Thanks.