scriptBoris / NavigationSam

Can intercept action navigation back by user
17 stars 1 forks source link

RequestPop not triggered on Android #2

Closed tonyfonager closed 3 years ago

tonyfonager commented 3 years ago

I have now gotten you Nuget to work on the iOS version of my app.

While working on the Android version, I have issues getting the "RequestPop()" method to be triggered.

I have installed it on the Android native project, I have added the stuff in MainActivity.cs, but whenever I run the app nothing happens.

One thing I noticed, is that when I add the breakpoints only the first breakpoint in the constructor are marked "Red" when the page is active, but the next breakpoint is just the white circle with a little red border, normally I would think this signals that the breakpoint will never be hit ?

image

Its frustrating, and I cannot seem to figure out whats going on.

I have your Github project loaded too, and the sample app works on both iOS and Android - so it could be something I have done wrong, but as mentioned first I should have followed all instructions!

tonyfonager commented 3 years ago

Here is my MainActivity.cs code :

image

And this line inside OnCreate :

image

scriptBoris commented 3 years ago

I will deal with this problem in the near future.

tonyfonager commented 3 years ago

Thanks, it might be an issue in my end, as it works in your sample but not in my app!

scriptBoris commented 3 years ago

@tonyfonager for fun, can you clone the Sample Project and test the function RequestPop() there?

tonyfonager commented 3 years ago

@tonyfonager for fun, can you clone the Sample Project and test the function RequestPop() there?

What do you mean ? I already have your Github project locally, and when running the sample it works on Android too ?

scriptBoris commented 3 years ago

https://github.com/scriptBoris/NavigationSam.git - yeah, on Android worked.

Test project for Android is working. You need to clone it and check it out. If catching the back button doesn't work, then the problem is in the library. If intercepting the back button works, then the problem is in your project.

scriptBoris commented 3 years ago

Sorry I didn't read your post above :)

tonyfonager commented 3 years ago

If catching the back button doesn't work, then the problem is in the library. If intercepting the back button works, then the problem is in your project.

There is a difference - your sample project uses the lib/source as a referenced project.

My project uses a Nuget.

Not sure if thats relevant, but its the only reason I have found so far.

I can try "copying" you test pages into my project, to see if it works there too ....

tonyfonager commented 3 years ago

I have the same issues, when moving your test pages to my project. Its not triggered, and breakpoints inside the "RequestPop" function are white (not read) when class is loaded.

tonyfonager commented 3 years ago

I now tried taking your sample project, removed the "NavigationSam" project and added references via Nuget instead.

Still works ... so the verdict must be that it for some reason does not work only in my project! Bummer!

scriptBoris commented 3 years ago

@tonyfonager I found the problem. It will be fixed in the next version of the Nuget package. I apologize for not being able to test it accurately.

scriptBoris commented 3 years ago

@tonyfonager nuget 1.0.3 is published. Can you try? It should work 👍🏻