Ehsan
Ehsan

Reputation: 517

how open an intent using webview in android?

I am using Vudriod to show pdf on my own app. If i run this code I can see the pdf:

final Intent intent = new Intent(Intent.ACTION_VIEW, uri);

String uriString = uri.toString();

String extension = uriString.substring(uriString.lastIndexOf('.') + 1);

intent.setClass(this, extensionToActivity.get(extension));

startActivity(intent);

But i need to open pdf using webview because i have html interactions and want to overload html on top the pdf. is it possible to show the intent inside webview instead of using startactivity?

if it is not possible, is it possible to open webview upon activity but in transparent background. Then call zoomin and scrolling event of intent when webview got these events?

I am very new in android, please help me. Thanks

Upvotes: 0

Views: 1880

Answers (1)

Naveen Tamrakar
Naveen Tamrakar

Reputation: 3339

String googleDocs = "https://docs.google.com/viewer?url="; 
mWebView.loadUrl(googleDocs + url);

Upvotes: 0

Related Questions