mirror of https://github.com/jlelse/teleposter
Add missing onBackPressed
This commit is contained in:
parent
77d45a4d37
commit
e5fa595bbf
|
@ -27,10 +27,6 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
|
|||
addPermittedHostname("telegra.ph")
|
||||
}
|
||||
|
||||
webView?.settings?.apply {
|
||||
|
||||
}
|
||||
|
||||
// Check if app is opened to show special page
|
||||
var urlToLoad = TELEGRAPH
|
||||
if (intent.action == Intent.ACTION_VIEW && !intent.dataString.isNullOrBlank() && intent.dataString.contains("telegra.ph"))
|
||||
|
@ -76,6 +72,11 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
|
|||
webView?.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (webView?.onBackPressed() == false) return
|
||||
else super.onBackPressed()
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
super.onCreateOptionsMenu(menu)
|
||||
menuInflater.inflate(R.menu.activity_main, menu)
|
||||
|
|
Loading…
Reference in New Issue