How to close mobile modalview onBackPressed in android

7 posts, 0 answers
  1. Sulthon Muhammad
    Sulthon Muhammad avatar
    4 posts
    Member since:
    Nov 2012

    Posted 06 Jan 2013 Link to this post

    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..

  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 09 Jan 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Sulthon Muhammad
    Sulthon Muhammad avatar
    4 posts
    Member since:
    Nov 2012

    Posted 09 Jan 2013 Link to this post

    Thanks.. it's worked.. 
  5. Ralph
    Ralph avatar
    33 posts
    Member since:
    Oct 2012

    Posted 31 Jul 2013 Link to this post

    Hi Dimo,

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

    Thanks!

    BR,
    Ralph
  6. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 31 Jul 2013 Link to this post

    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!
  7. Michael
    Michael avatar
    151 posts
    Member since:
    Jan 2012

    Posted 12 Nov 2013 Link to this post

    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?
  8. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 14 Nov 2013 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready