Using android back key

I am trying to build a mobile app. it is a single page app with 3 groups. in order to navigate through groups, i am using show and hide feature.

I wrapped the app and i tried. when i press the back key, the app is closing instead of going back to the previous screen.

my question is: if i want to go back from a group to previous group, can i use android device back key? how can i do it in workflow.

1 Like

To go back you should hide current group and show the one you want go back to. To do so you need to configure a button or icon on on your app (not the android back button)

You might face some bugs if you use complicated animation for transition too often.

Another option is to wrap it with a native navigation bar or a slider menu for smooth change of views. You can do so with nativator.io

that means its not possible to do with device back key.?

Not that I am aware of.

Hi @bentoj72

TIPS

As @Sam mentioned, I’m using a standard return button. If the user uses his Android BACK button the solution is to have two pages: index and page 1. By default, we are on page 1. Using the back, the index page appears (an empty page), and redirects to page 1. A delay of 3-4 sec each time, but your application will no longer close. You can send an alert message asking not to use the button as well.

1 Like

Hai john. still the app is clossing.
I did as follows. am I doing something wrong?

You could setup conditions on the group to show only when a URL parameter equals a value.

For example, if you had a login popup you would set the condition:

  • Get data from URL “action” is “loginpopup”
  • This element is visible

You would set those statements on all groups and just use the URL parameter “action”. When a button or an element is click run a workflow action:

  • go to page (current page)
  • send parameters - action = “your action”

You would have to set the main group that is visible on page load to have a conditional statement as follows:

  • Get data from URL “action” is empty - element visible
  • Get data from URL “action” is not empty - element is hidden

I had this same setup on an application with bubble and wrapped it in a web view for Android. The back button will go to the previous URL which acts as a stepped back like a native app, but your page won’t reload as bubble handles non reload same page actions.

5 Likes

Hi @bentoj72

You did the right thing. It seems that inside the ‘Wrapper’ on Android, detection of ‘<480’ does not work. I didn’t completely grasp the @keedanpunch example but I understand that adding a calling URL to itself it will loop Android’s BACK key. I’ll try it when I’m in the Android universe in a few days.

add: It just checked with my Android, and it closed the app. My tips do not work under Android Wrapper or home screen app registration, but only under Chrome directly. The best approach is the one proposed by @keedanpunch. For the ‘wrapper’ with Jasonelle, I know it is possible to capture the command, and prevent the use of the Back. I’ll share my results when I get there.

1 Like

thank you so much. its working :blush:

1 Like

yes you are correct.its working in browser and not working in jasonelle by default.

1 Like

Hai @keedanpunch
its perfectly working in browser and not working in wrapper. we have to add something to make it active in wrapper. I am using jasonelle with android studio.

This topic was automatically closed after 70 days. New replies are no longer allowed.