私のアプリケーションでは、viewPager を使用して素敵なスワイプ ビューを提供しています。キーボードを 2 つのページで非表示にしたいのですが、テキスト ボックスがある 1 つのページで常に表示します。
キーボードを表示するためにさまざまな方法を試しましたが、うまくいきません。間違った場所でディスプレイ キーボード コードを呼び出しているに違いないと思います。
@Override
public Object instantiateItem( View collection, int position )
{
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = null;
if(position==0){
layout=inflater.inflate(R.layout.other, null);
//new PC().create(layout, context);
((InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(collection.getWindowToken(), 0);
}else if(position==1){
layout=inflater.inflate(R.layout.main, null);
new BlurayRemote().create(layout,context);
((InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(collection.getWindowToken(), 0);
}else if(position==2){
layout=inflater.inflate(R.layout.text, null);
new TextInput().create(layout,context);
((InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInputFromInputMethod(collection.getWindowToken(), 0);
}
((ViewPager) collection).addView(layout);
return layout;
}
それは私を怒らせているので、どんな助けも素晴らしいでしょう!