Пример #1
0
 private void select_pics() {
   // 实例化SelectPicPopupWindow
   popupWindow = new SelectPicsPopupWindow(getActivity(), itemsOnClick1);
   // 显示窗口
   popupWindow.showAtLocation(
       getActivity().findViewById(R.id.llayout_main),
       Gravity.BOTTOM,
       0,
       0); // 设置layout在PopupWindow中显示的位置
 }
Пример #2
0
 @Override
 public void onClick(View view) {
   popupWindow.dismiss();
   switch (view.getId()) {
     case R.id.btn_camera:
       camera();
       break;
     case R.id.btn_photo:
       Intent intent = new Intent(Intent.ACTION_PICK, null);
       intent.setDataAndType(
           MediaStore.Images.Media.EXTERNAL_CONTENT_URI, IMAGE_UNSPECIFIED);
       intent.putExtra("return-data", true);
       startActivityForResult(intent, PHOTOZOOM);
       break;
   }
 }