LayoutInflater layoutInflater = (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
popupView = layoutInflater.inflate(R.layout.help_popup, null);
popupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
popupWindow.setFocusable(true);
popupWindow.setTouchable(true);
popupWindow.setOutsideTouchable(false);
popupWindow.getContentView().setFocusableInTouchMode(true);
popupWindow.getContentView().setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
return true;
}
return false;
}
});
popupWindow.showAtLocation(mRootView, Gravity.CENTER, popPosX, popPosY);
'programmer > android' 카테고리의 다른 글
status bar (0) | 2013.07.08 |
---|---|
highlighting via keyboad (0) | 2013.07.04 |
usb event broadcastreceiver (0) | 2013.07.03 |
ringtone/alarm tone 설정 (0) | 2013.07.01 |
seekbar progress 위치에 value 표시 (0) | 2013.06.25 |