Error message in the Logcat.
requestLayout() improperly called by android.widget.RelativeLayout{4046e3c I........ ......ID 0,168-1050,1521 #7f0d01a3 app:id/search_suggestions_section} during layout: running second layout pass
mSearchView.setOnMenuItemClickListener(new FloatingSearchView.OnMenuItemClickListener() {
@Override
public void onActionMenuItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_voice) {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
startActivityForResult(intent, SPEECH_REQUEST_CODE);
}
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {
List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
final String spokenText = results.get(0);
getActivity().runOnUiThread(new Runnable() {
public void run() {
mSearchView.setSearchText(spokenText);
}
});
}
}
Error message in the Logcat. requestLayout() improperly called by android.widget.RelativeLayout{4046e3c I........ ......ID 0,168-1050,1521 #7f0d01a3 app:id/search_suggestions_section} during layout: running second layout pass