public void menuClick(int which) { switch (which) { case 1: if (Util.existSDcard()) { Intent intent = new Intent(); // 调用照相机 String messagepath = StaticFactory.APKCardPath; File fa = new File(messagepath); if (!fa.exists()) { fa.mkdirs(); } fragment.cameraPath = messagepath + new Date().getTime(); // 图片路径 intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(fragment.cameraPath))); intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, AddPicFragment.Camera); } else { Toast.makeText(getApplicationContext(), "亲,请检查是否安装存储卡!", Toast.LENGTH_SHORT).show(); } break; case 0: if (Util.existSDcard()) { String messagepath = StaticFactory.APKCardPath; File fa = new File(messagepath); if (!fa.exists()) { fa.mkdirs(); } PhotoAlbumMainActivity_.intent(this) .maxnum(6) .paths(fragment.getSdibs()) .startForResult(AddPicFragment.Album); } else { Toast.makeText(getApplicationContext(), "亲,请检查是否安装存储卡!", Toast.LENGTH_SHORT).show(); } break; } }
/** 根据不同的平台设置不同的分享内容</br> */ public void setShareContent(UMSocialService mController) { // 设置分享内容 // 配置SSO mController.getConfig().setSsoHandler(new SinaSsoHandler()); mController.setShareContent(Constants.shareContent); UMImage urlImage = null; try { urlImage = new UMImage(this, BitmapFactory.decodeStream(getAssets().open("share_icon.jpg"))); UMImage shareImage = new UMImage(this, BitmapFactory.decodeStream(getAssets().open("share.jpg"))); mController.setShareImage(shareImage); } catch (IOException e) { e.printStackTrace(); } // 设置朋友圈分享的内容 CircleShareContent circleMedia = new CircleShareContent(); circleMedia.setTitle(Constants.wxShareTitle); circleMedia.setShareContent(Constants.shareContent); circleMedia.setShareImage(urlImage); circleMedia.setTargetUrl(Constants.shareUrl); mController.setShareMedia(circleMedia); // 设置QQ空间分享内容 QZoneShareContent qzone = new QZoneShareContent(); Util.shareContent(qzone, urlImage); mController.setShareMedia(qzone); QQShareContent qqContent = new QQShareContent(); Util.shareContent(qqContent, urlImage); mController.setShareMedia(qqContent); // 设置微信分享内容 WeiXinShareContent weixinContent = new WeiXinShareContent(); Util.shareContent(weixinContent, urlImage); mController.setShareMedia(weixinContent); }
@OptionsItem(R.id.ok) public void ok() { if (!isOk) { return; } // String content = Util.FilterEmoji(edittxt.getText().toString().trim()); String content = edittxt.getText().toString().trim(); // content=EmojiFilter.filterEmoji(content); if (!Util.isStrNotNull(content) && fragment.getCount() == 0) { showCustomToast("请输入内容或添加图片"); return; } isOk = false; customShowDialog("正在定位"); location.startLocation(); }
public RequestParams getAjaxParams() { return Util.getAjaxParams(this); }
public void customShowDialog(int i) { progressDialog = Util.progress(this, str[i]); }
public void customShowDialog(String str) { progressDialog = Util.progress(this, str); }
public void showCustomToast(String str) { Util.toast(this, str); }
protected void showKeyBoard() { Util.showKeyBoard(this); }