klinker41 / article-android

Android library for displaying web articles in a readable format
Other
153 stars 26 forks source link

[Request] Open in default browser instead of custom tab. #25

Closed aminecmi closed 7 years ago

aminecmi commented 7 years ago

Hi,

I'm currently using the library on my app, and I have one question and one request.

Is it normal that the "Open in chrome" inside the article viewer opens links in a Chrome custom tab ? If it's the intended behavior, I think that the button isn't named well.

Would it be possible to customize the "Open ..." action, so we could use our own Chrome custom tab, or open links in the default user browser?

Thanks!

klinker41 commented 7 years ago

This is the expected behavior and probably not something I'm planning on changing. From the custom tab you can open in the full chrome app if you want, but it isn't something I'll put into the library.

aminecmi commented 7 years ago

Well, can you at least check if the user has Chrome installed (or chrome as default browser), because the library is causing issues on my app.

Coming from xyz.klinker.android.article.ArticleActivity.openChromeCustomTab

Fatal Exception: android.content.ActivityNotFoundException
No Activity found to handle Intent { act=android.intent.action.VIEW dat= (has extras) }

android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1809)
android.support.customtabs.CustomTabsIntent.launchUrl (CustomTabsIntent.java:262)
xyz.klinker.android.article.ArticleActivity.openChromeCustomTab (ArticleActivity.java:203)
xyz.klinker.android.article.ArticleActivity.onArticleLoaded (ArticleActivity.java:101)
xyz.klinker.android.article.ArticleUtils$5.run (ArticleUtils.java:233)
android.os.Handler.handleCallback (Handler.java:751)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:776)
klinker41 commented 7 years ago

Please feel free to submit a pull request for it.