「android」PopupWindowで画面内にダイアログを表示、隠す方法
PopupWindowを表示:
public void showPopupWindow(){
Context context = PopupWindowCalendar.this;
LayoutInflater fliter = (LayoutInflater) context.getSystemService(LAYOUT_INFLATER_SERVICE);
View calendarWindow = fliter.inflate(R.layout.date_popup, null);
final PopupWindow popupWindow = new PopupWindow(calendarWindow, LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT, true);
ColorDrawable dw = new ColorDrawable(-00000);
popupWindow.setBackgroundDrawable(dw);
popupWindow.showAtLocation(findViewById(R.id.main), Gravity.LEFT|Gravity.TOP, 150, 200);
}
PopupWindowを隠す:
popupWindow.dismiss();