安卓问题,发信息出现这个,怎么取消这个弹窗 小柏,求老手指点下
---------首先先贴大神的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();
}
}
回答:
如果你在发送信息时出现了弹窗,这可能是因为该应用程序需要访问一些敏感权限或需要用户确认某些操作。如果你想取消这个弹窗,你可以尝试以下方法:
你可以检查应用程序的权限,看看哪些权限可能导致弹窗出现。你可以通过进入应用程序管理页面或使用第三方权限管理应用程序来查看应用程序权限。
有些应用程序的弹窗是来自通知的。你可以尝试关闭应用程序的通知,具体方法如下:
关闭通知开关。
更改应用程序设置
有些应用程序可能在设置中提供了选项来关闭弹窗。你可以尝试在应用程序设置中找到这些选项,关闭弹窗。具体方法如下:
如果以上方法都不起作用,你可能需要进一步调查这个问题。你可以向应用程序开发者提出问题,或者尝试查看应用程序的日志,找出问题的根本原因。
我无法提供更具体的解决方案,因为我需要更多的信息来了解你所遇到的具体问题。针对不同的应用程序和弹窗,可能需要不同的解决方案。如果你能提供更多的信息,我可以尝试提供更具体的帮助。