|
|
@ -8,20 +8,22 @@ import io.legado.app.ui.main.MainActivity |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FileAssociation : VMBaseActivity<FileAssociationViewModel>(R.layout.activity_file_association) { |
|
|
|
class FileAssociation : |
|
|
|
|
|
|
|
VMBaseActivity<FileAssociationViewModel>(R.layout.activity_file_association) { |
|
|
|
override val viewModel: FileAssociationViewModel |
|
|
|
override val viewModel: FileAssociationViewModel |
|
|
|
get() = getViewModel(FileAssociationViewModel::class.java) |
|
|
|
get() = getViewModel(FileAssociationViewModel::class.java) |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
if (null != intent.data){ |
|
|
|
intent.data?.let { data -> |
|
|
|
val newIntent = viewModel.dispatchIndent(intent.data!!) |
|
|
|
val newIntent = viewModel.dispatchIndent(data) |
|
|
|
if (newIntent != null){ |
|
|
|
if (newIntent != null) { |
|
|
|
this.startActivityForResult(newIntent, 100) |
|
|
|
this.startActivityForResult(newIntent, 100) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
gotoMainActivity() |
|
|
|
gotoMainActivity() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
super.onActivityResult(requestCode, resultCode, data) |
|
|
|
super.onActivityResult(requestCode, resultCode, data) |
|
|
|
|
|
|
|
|
|
|
@ -29,7 +31,7 @@ class FileAssociation : VMBaseActivity<FileAssociationViewModel>(R.layout.activi |
|
|
|
gotoMainActivity() |
|
|
|
gotoMainActivity() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun gotoMainActivity(){ |
|
|
|
private fun gotoMainActivity() { |
|
|
|
val mIntent = Intent() |
|
|
|
val mIntent = Intent() |
|
|
|
mIntent.setClass(this, MainActivity::class.java) |
|
|
|
mIntent.setClass(this, MainActivity::class.java) |
|
|
|
startActivity(mIntent) |
|
|
|
startActivity(mIntent) |
|
|
|