简体   繁体   English

Is it possible to open a facebook group link in facebook app from android webview application build by android studio

[英]Is it possible to open a facebook group link in facebook app from android webview application build by android studio

I want to know is it possible to open a facebook group link in facebook app from android webview application build by android studio. I want to know is it possible to open a facebook group link in facebook app from android webview application build by android studio.

is there any html and JavaScript for that.是否有任何 html 和 JavaScript 。

With webview in android studio, you can only open links inside your app and not outside.在 android 工作室中使用 webview,您只能在应用程序内部而不是外部打开链接。

In your case, you want a facebook group link to be opened in the facebook app which may not be possible using Webview.在您的情况下,您希望在 facebook 应用程序中打开 facebook 组链接,这可能无法使用 Webview。

That's why you need to use WebViewClient.这就是您需要使用 WebViewClient 的原因。 You need to override shouldOverrideUrlLoading method and start an intetn with the package "com.facebook"您需要覆盖shouldOverrideUrlLoading方法并使用 package "com.facebook" 启动一个 intetn

Check this answer: https://stackoverflow.com/a/50293855/12802591检查这个答案: https://stackoverflow.com/a/50293855/12802591

You may need to test if the user already had facebook app installed then open the group link there, if not it will open the group link inside the web view.您可能需要测试用户是否已经安装了 facebook 应用程序,然后在那里打开组链接,如果没有,它将在 web 视图中打开组链接。

Another useful link:另一个有用的链接:

https://stackoverflow.com/a/54589702/12802591 https://stackoverflow.com/a/54589702/12802591

Let me know if it works !让我知道它是否有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM