Can`t setup back button for Web_Viewer2

I am using two layouts containing webviewer.I’m trying to place the back press command for both,for web viewer 1 its working,but for web viewer2 ,its not.can someone give me a solution?

Use elseif for the not can go back or just else

as you arranged blocks, it will check for both at same time, so you have to use “else” @George_Loungos said.

thanks for your reply,but I used 'else ’ first, I was facing same problem then tried without else, the problem remain same.

but if web1 cant go back it will close screen, will not check web2,

web1 is working well with back press,problem is with web2. if web 2 cant go back, I wish web 1 home will be open. Can you give me the solution? ‘else if’ not working.

2

Tried like the above pic…problem is web2,after going to a link by web2,when I press back,app is closing instead of go back to home url. web1 working fine.

We didn’t say to do it like this. You have to put elseif only to the not can go back

blocks

3

I think you are talking about this way,now web2 go back working,but facing different problem.After go back web2 home,when I click on menu for web1, it shows white screen .

Which menu?

5

Side menu…after clicking back for once, side menu options not working .It shows only white screen.

Hi @mashayekh.official
Can I know what do you want exactly?

I’m using 2 web viewers in a screen.Now I’m trying to adjust the back press.I tried like the above pictures,but facing two problems:

  1. back press from web2 home shows white screen
  2. when I click back for once,cant go other screen/layout by clicking side menu,it shows white screen

I am still not understanding what you want to do exactly.
There are some question you have to answer in detail.
How it will work? is one of them.

There are two layouts in a screen.
both containing web view component.
Suppose, web1 home is google.com and web2 home is facebook.com
there are two side menu items,when item1 clicked,layout1 (containing web1) will be visible and when item2 clicked layout2 (containing web2) will be visible and layout1 will go false.

And when web2 cant go back,I want that web1 will appear after back press.

I tried like the picture,but after pressing back for one time, cant go another layout by menu items,it shows white screen. and back press from web2 home shows white screen2.Hope you understand.

5

Try this:

   if(!((Web_Viewer2.Can Go Back)&&(Web_Viewer1.Can Go Back))){
    close application;
   }
  else{
   if(Web_Viewer2.Can Go Back){
    Web_Viewer2.Go Back;
}
 else if(Web_Viewer1.Can Go Back){
 Web_Viewer1.Go Back;
}
   else{
   Swipe_Refresh_Layout1.visible(true);
  Swipe_Refresh_Layout2.visible(false);
}
  }

1 Like

Problem remains same.

Little improvement; Now both web view back press working fine, but after reaching the home screen of both, it shows white screen if I press back again.Blocks marked at the picture are not working.