Detect back button but don't dismiss dialogfragment

后端 未结 9 1192
时光取名叫无心
时光取名叫无心 2020-11-30 02:00

I have a dialogfragment for a floating dialog which includes a special keyboard that pops up when a user presses inside an EditText field (the normal IME is stopped from bei

9条回答
  •  无人及你
    2020-11-30 02:46

    Use Fragment onCancel override method. It's called when you press back. here is a sample:

    @Override
    public void onCancel(DialogInterface dialog) {
        super.onCancel(dialog);
    
        // Add you codition
    }
    

提交回复
热议问题