在androidjava中读取其他任何应用程序的通知,并从通知中下载图像

问题描述

我正在尝试阅读其他应用程序的通知。如果通知中有图片,则下载该图片。我已成功下载映像,但是在同一通知中有2个或多个映像而不是失败时,在此附加了我的代码。请让我知道如何处理的解决方案。 预先感谢。

public void saveFile(Bitmap outputimage,String senderName){


    File storagePath = new File(Environment.getExternalStorageDirectory() + "/Folder Name/");
    storagePath.mkdirs();

    String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm").format(new Date());
    String mImageName="MI_"+ timeStamp +".jpg";

    File myImage = new File(storagePath,Long.toString(Long.parseLong(senderName)) + ".jpg");

    try {
        FileOutputStream out = new FileOutputStream(myImage);
        outputimage.compress(Bitmap.CompressFormat.JPEG,80,out);
        out.flush();
        out.close();
    } catch (Exception e) {
        e.printstacktrace();
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)