を使用して、レイアウトの一部を正常に非表示にしました
activityRootView = findViewById(R.id.bottom_layout);
activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
int heightDiff = activityRootView.getRootView().getHeight() - activityRootView.getHeight();
System.out.println("Height: "+heightDiff);
if (heightDiff > 100) { // if more than 100 pixels, its probably a keyboard...
RelativeLayout bottom = (RelativeLayout)findViewById(R.id.bottom_layout);
bottom.setVisibility(View.GONE);
}else {
RelativeLayout bottom = (RelativeLayout)findViewById(R.id.bottom_layout);
bottom.setVisibility(View.VISIBLE);
}
}
});