安卓问题,发信息出现这个,怎么取消这个弹窗 小柏,求老手指点下
1条回答 默认 最新
关注
- 你可以看下这个问题的回答https://ask.csdn.net/questions/7800397
- 我还给你找了一篇非常好的博客,你可以看看是否有帮助,链接:微信小程序iOS兼容问题,苹果手机白屏,页面不加载,安卓手机正常
- 除此之外, 这篇博客: 安卓仿微信上传图片问题中的 最近做了安卓仿微信上传图片,果断把大神的demo拷了过来,后来发现上传的时候出现了几个问题,那个博客下老是提醒链接过多,评论不了,就搬到这了## 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
---------首先先贴大神的demo地址:http://blog.csdn.net/jdsjlzx/article/details/44160603#html
获取的图片就是null,尤其是拍照的,我就把那个FileUtil那个存储bitmap的方法给返回了一个路径,然后就好了,下面是照相机返回的路径
//照相机 public void photo() { Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(openCameraIntent, TAKE_PICTURE); } //照相机返回的图片 protected void onActivityResult(int requestCode, int resultCode, final Intent data) { switch (requestCode) { case TAKE_PICTURE: if (Bimp.tempSelectBitmap.size() < 9 && resultCode == RESULT_OK) { new Thread(new Runnable() { @Override public void run() { String fileName = String.valueOf(System.currentTimeMillis() + ".png"); Bitmap bm = (Bitmap) data.getExtras().get("data"); String path = FileUtils.saveBitmap(bm, fileName); ImageItem takePhoto = new ImageItem(); takePhoto.setBitmap(bm); takePhoto.setImagePath(path); Bimp.tempSelectBitmap.add(takePhoto); } }).start(); } break; } }
--------Fileutil中return SDPATH + picName;就可以了,办法有点笨,但是不出错
2.在GridAdapter中的update()方法中,要么给loading()中的else后面添加break;要么改成adapter.notifyDataSetChanged();
之后就不会出现oom,并且导致时不时点不了的情况了//所选图片适配 @SuppressLint("HandlerLeak") public class GridAdapter extends BaseAdapter { private LayoutInflater inflater; private int selectedPosition = -1; private boolean shape; public boolean isShape() { return shape; } public void setShape(boolean shape) { this.shape = shape; } public GridAdapter(Context context) { inflater = LayoutInflater.from(context); } public void update() { // loading(); adapter.notifyDataSetChanged(); } public int getCount() { if (Bimp.tempSelectBitmap.size() == 9) {//最多选9张图片 return 9; } return (Bimp.tempSelectBitmap.size() + 1); } public Object getItem(int arg0) { return null; } public long getItemId(int arg0) { return 0; } public void setSelectedPosition(int position) { selectedPosition = position; } public int getSelectedPosition() { return selectedPosition; } public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.item_upload_gridview, parent, false); holder = new ViewHolder(); holder.image = (ImageView) convertView .findViewById(R.id.item_grida_image); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } if (Bimp.tempSelectBitmap != null) { if (position == Bimp.tempSelectBitmap.size()) { holder.image.setImageBitmap(BitmapFactory.decodeResource( getResources(), R.mipmap.ic_add_img));//加号 if (position == 9) {//只能选9张图片 holder.image.setVisibility(View.GONE); } } else { holder.image.setImageBitmap(Bimp.tempSelectBitmap.get(position).getBitmap()); imagePath = Bimp.tempSelectBitmap.get(position).getImagePath();//这是相册选中的图片路径,大神有说的 map.put(position, imagePath); System.out.println("list选中上传的集合---" + map.size()); System.out.println("list选中上传的集合Path---" + map.get(position)); } } return convertView; } public class ViewHolder { public ImageView image; } Handler handler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case 1: adapter.notifyDataSetChanged(); break; } super.handleMessage(msg); } }; //添加break,就可以调用 public void loading() { new Thread(new Runnable() { public void run() { while (true) { if (Bimp.max == Bimp.tempSelectBitmap.size()) { Message message = new Message(); message.what = 1; handler.sendMessage(message); break; } else { Bimp.max += 1; Message message = new Message(); message.what = 1; handler.sendMessage(message); break;//在这添加 } } } }).start(); } }
- 您还可以看一下 刘欢老师的从前端到后台,开发一个完整功能的小程序课程中的 搭建与设置服务器域名小节, 巩固相关知识点
- 以下回答由chatgpt基于相关博客总结生成:
回答:
如果你在发送信息时出现了弹窗,这可能是因为该应用程序需要访问一些敏感权限或需要用户确认某些操作。如果你想取消这个弹窗,你可以尝试以下方法:
- 查看应用程序权限
你可以检查应用程序的权限,看看哪些权限可能导致弹窗出现。你可以通过进入应用程序管理页面或使用第三方权限管理应用程序来查看应用程序权限。
- 关闭应用程序通知
有些应用程序的弹窗是来自通知的。你可以尝试关闭应用程序的通知,具体方法如下:
- 在手机设置中找到“应用程序管理”;
- 找到你想关闭通知的应用程序;
-
关闭通知开关。
-
更改应用程序设置
有些应用程序可能在设置中提供了选项来关闭弹窗。你可以尝试在应用程序设置中找到这些选项,关闭弹窗。具体方法如下:
- 在手机设置中找到“应用程序管理”;
- 找到你要更改设置的应用程序;
- 打开应用程序设置,并查找与弹窗相关的设置选项;
- 关闭弹窗选项。
如果以上方法都不起作用,你可能需要进一步调查这个问题。你可以向应用程序开发者提出问题,或者尝试查看应用程序的日志,找出问题的根本原因。
我无法提供更具体的解决方案,因为我需要更多的信息来了解你所遇到的具体问题。针对不同的应用程序和弹窗,可能需要不同的解决方案。如果你能提供更多的信息,我可以尝试提供更具体的帮助。
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 1