小编Aji*_*dam的帖子

D/skia: --- 无法创建带有消息“未实现”的图像解码器

我在我的项目中使用https://github.com/jhansireddy/AndroidScannerDemo这个扫描库。

当我捕获图像时,我进入D/skia: --- Failed to create image decoder with message 'unimplemented'控制台并且捕获的图像未设置为Android P 中的图像视图。

同样,当我在Android Q 中测试相同的应用程序时,出现以下错误。

2020-02-05 11:32:23.668 9270-9270/? E/ReviewScreenImpl: onClickOKButton() - Fail to decode captured picture

有人可以帮助解决上述问题。

android android-manifest android-camera android-fileprovider

13
推荐指数
1
解决办法
2万
查看次数

PDF 立即打开和关闭

在我的应用程序中,我将 pdf 下载到下载文件夹,并尝试使用以下代码打开。

String FileName="CardsDecks";
File imagePath = new File(this.getFilesDir(), "Download");
File newFile = new File(imagePath, FileName+ ".pdf");
Uri contentUri = FileProvider.getUriForFile(this, "com.cards.mycards.fileprovider", newFile);

Intent intent =new Intent(Intent.ACTION_VIEW)                                
    .setDataAndType(contentUri, "application/pdf")
    .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

Intent intent1 = Intent.createChooser(intent, "Open File");

startActivity(intent1);
Run Code Online (Sandbox Code Playgroud)

清单文件中的提供程序定义

<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.cards.mycards.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
</provider>
Run Code Online (Sandbox Code Playgroud)

provider_paths.xml

<paths>
    <files-path name="CardsDecks" path="." />
</paths>
Run Code Online (Sandbox Code Playgroud)

该应用程序仅显示用于打开文件的驱动器 pdf 查看器和 word 选项,而不显示手机中的 pdf 查看器。

当我单击驱动器 pdf 查看器时,它会立即打开和关闭。我已经检查了下载文件夹中的文件,文件存在于其中,其中包含内容。

请帮助以上。

java android android-pdf-api androidpdfviewer

8
推荐指数
1
解决办法
592
查看次数