Merge pull request #11613 from t895/import-fix

Android: Initialize TaskViewModel earlier in User Data Activity
This commit is contained in:
JosJuice 2023-03-01 17:53:59 +01:00 committed by GitHub
commit c5e00b085e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,8 @@ class UserDataActivity : AppCompatActivity() {
private lateinit var mBinding: ActivityUserDataBinding private lateinit var mBinding: ActivityUserDataBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
taskViewModel = ViewModelProvider(this)[TaskViewModel::class.java]
ThemeHelper.setTheme(this) ThemeHelper.setTheme(this)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -81,7 +83,6 @@ class UserDataActivity : AppCompatActivity() {
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
taskViewModel = ViewModelProvider(this)[TaskViewModel::class.java]
if (requestCode == REQUEST_CODE_IMPORT && resultCode == RESULT_OK) { if (requestCode == REQUEST_CODE_IMPORT && resultCode == RESULT_OK) {
val arguments = Bundle() val arguments = Bundle()
arguments.putString( arguments.putString(