Do not request data onDismiss

This commit is contained in:
Mygod
2018-12-30 17:44:18 +08:00
parent d26c4587f2
commit f0a89d5498
2 changed files with 2 additions and 2 deletions

View File

@@ -20,6 +20,6 @@ abstract class AlertDialogFragment : DialogFragment(), DialogInterface.OnClickLi
override fun onDismiss(dialog: DialogInterface?) { override fun onDismiss(dialog: DialogInterface?) {
super.onDismiss(dialog) super.onDismiss(dialog)
targetFragment?.onActivityResult(targetRequestCode, Activity.RESULT_CANCELED, data) targetFragment?.onActivityResult(targetRequestCode, Activity.RESULT_CANCELED, null)
} }
} }

View File

@@ -124,7 +124,7 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
setNeutralButton(R.string.repeater_wps_dialog_pbc, listener) setNeutralButton(R.string.repeater_wps_dialog_pbc, listener)
} }
override val data: Intent get() = Intent() override val data: Intent get() = Intent()
.putExtra(KEY_PIN, dialog.findViewById<EditText>(android.R.id.edit)?.text.toString()) .putExtra(KEY_PIN, dialog.findViewById<EditText>(android.R.id.edit)?.text?.toString())
override fun onCreateDialog(savedInstanceState: Bundle?) = super.onCreateDialog(savedInstanceState).apply { override fun onCreateDialog(savedInstanceState: Bundle?) = super.onCreateDialog(savedInstanceState).apply {
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE) window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)