This is a migrated thread and some comments may be shown as answers.

How to close mobile modalview onBackPressed in android

6 Answers 157 Views
ModalView
This is a migrated thread and some comments may be shown as answers.
Sulthon Muhammad
Top achievements
Rank 1
Sulthon Muhammad asked on 06 Jan 2013, 10:37 PM
Anyone can give me guide how to Close modal view onBackPressed in android..
cause it's feel wierd if someone press back key and the page changed.. but the modal view still there.. 

Thanks before..

6 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Jan 2013, 09:15 AM
Hi Sulthon,

You can use the hide event of the parent view and close the modal view there.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sulthon Muhammad
Top achievements
Rank 1
answered on 09 Jan 2013, 07:12 PM
Thanks.. it's worked.. 
0
Ralph
Top achievements
Rank 1
answered on 31 Jul 2013, 10:00 AM
Hi Dimo,

Is it possible that in such scenario only the modal view is closed but the view is not hidden?

Thanks!

BR,
Ralph
0
Dimo
Telerik team
answered on 31 Jul 2013, 12:17 PM
Hello Ralph,

The current ModalView implementation does not allow such a behavior, but we plan to include this feature for some of the next Kendo UI versions.

Currently you could achieve the desired result with PhoneGap, which allows intercepting the Back button click.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Michael
Top achievements
Rank 1
answered on 12 Nov 2013, 10:57 PM
what if the modal does not have a parent view and is instead implemented on the app body level. is there any way to close the modal onbackpressed?
0
Petyo
Telerik team
answered on 14 Nov 2013, 11:28 AM
Hello Michael,

In our next release, we are going to expose a "back" event of the router component (available , which will be used for such purposes. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ModalView
Asked by
Sulthon Muhammad
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Sulthon Muhammad
Top achievements
Rank 1
Ralph
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or