Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes "exposed beyond app through Intent.getData()" #187

Open
JeffTyfoom opened this issue Jun 30, 2022 · 0 comments
Open

App crashes "exposed beyond app through Intent.getData()" #187

JeffTyfoom opened this issue Jun 30, 2022 · 0 comments

Comments

@JeffTyfoom
Copy link

The app will crash when we tap a link (inside the pdf ) that begins with "file://". The exception thrown is "exposed beyond app through Intent.getData()".

Sample link file:///C:/Users/Sample/Downloads/Sample%20Project%20Inc.%20User%20Guide%20(1).pdf

For the meantime I forked the app and put a try catch block inside the handleUri method.

Like this :
private void handleUri(String uri) {
// If the property is true just pass the link back to flutter
if (!this.preventLinkNavigation) {
try{
Uri parsedUri = Uri.parse(uri);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(parsedUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent, null);
}
}catch (Exception ignored){}
}
this.onLinkHandler(uri);
}

https://github.com/JeffTyfoom/flutter_pdfview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant