Android: button in IME's suggestion bar not clickable
I'm subclassing InputMethodService
to create my own personal keyboard. A lot of stuff already works quite nice. But now I'm playing around with the suggestion bar (also called "candiate view"). For now I'm just trying to load a static layout with one button in it:
@Override public View onCreateCandidatesView() {
LayoutInflater mLayoutInflater = LayoutInflater.from(this);
mView = mLayoutInflater.inflate(R.layout.suggestion_bar, null);
return mView;
}
The result looks like t开发者_如何学运维his:
Which is exactly what I expected, but with one big issue: the button in the suggestion bar is not selectable or clickable at all.
Any thoughts?
Did you implement the interfaces for clicking, etc in your view? Also the View class has a static method to inflate views so you can just say
View.inflate(R.layout.suggestion_bar, null);
instead of keeping a reference to the inflater.
精彩评论