Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sdex committed Sep 5, 2021
1 parent 548e3a0 commit 4b123ba
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ class ManifestViewerActivity : BaseActivity() {
private lateinit var appPackageName: String

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
try {
super.onCreate(savedInstanceState)
binding = ActivityManifestViewerBinding.inflate(layoutInflater)
} catch (e: Exception) {
// probably android.webkit.WebViewFactory.MissingWebViewPackageException
Toast.makeText(this, R.string.error_failed_to_instantiate_web_view, Toast.LENGTH_SHORT)
.show()
finish()
return
}
binding = ActivityManifestViewerBinding.inflate(layoutInflater)
setContentView(binding.root)
setupToolbar(isBackButtonEnabled = true)

Expand Down Expand Up @@ -117,10 +117,10 @@ class ManifestViewerActivity : BaseActivity() {
private const val ARG_NAME = "arg_name"

fun start(context: Context, model: ApplicationModel) {
val starter = Intent(context, ManifestViewerActivity::class.java)
starter.putExtra(ARG_PACKAGE_NAME, model.packageName)
starter.putExtra(ARG_NAME, model.name)
context.startActivity(starter)
context.startActivity(Intent(context, ManifestViewerActivity::class.java).apply {
putExtra(ARG_PACKAGE_NAME, model.packageName)
putExtra(ARG_NAME, model.name)
})
}
}
}

0 comments on commit 4b123ba

Please sign in to comment.