1
0
Fork 0

Issue #9815: Allow Intents to set HomeActivity.OPEN_TO_BROWSER.

master
Sebastian Kaspari 2020-05-26 13:56:36 +02:00
parent d54dbce7ba
commit 21bd379438
2 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,13 @@ class IntentReceiverActivity : Activity() {
private fun launch(intent: Intent, intentProcessorType: IntentProcessorType) {
intent.setClassName(applicationContext, intentProcessorType.activityClassName)
intent.putExtra(HomeActivity.OPEN_TO_BROWSER, intentProcessorType.shouldOpenToBrowser(intent))
if (!intent.hasExtra(HomeActivity.OPEN_TO_BROWSER)) {
intent.putExtra(
HomeActivity.OPEN_TO_BROWSER,
intentProcessorType.shouldOpenToBrowser(intent)
)
}
startActivity(intent)
finish() // must finish() after starting the other activity

View File

@ -205,6 +205,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
customTabSession = customTabSessionId?.let { sessionManager.findSessionById(it) },
openInFenixIntent = Intent(context, IntentReceiverActivity::class.java).apply {
action = Intent.ACTION_VIEW
putExtra(HomeActivity.OPEN_TO_BROWSER, true)
},
bookmarkTapped = { viewLifecycleOwner.lifecycleScope.launch { bookmarkTapped(it) } },
scope = viewLifecycleOwner.lifecycleScope,