How to get event onClick of ToolbarSwitcherButton

Product Version: 9.2.3-beta01
How to get event when click on button switch toolbar button ?
Example like video: 1.mov - Google Drive
How to know when I selected Annotate or Draw or Insert ?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Continuing discussion from Custom header tool bar - #16 by Shirley_Gong.

Firstly, you should consult your coworkers that have done previous work on DocumentView in React Native to get a basic understanding on how to get started.

Second, you will subscribe the toolbar switching event as follows:
mPdfViewCtrlTabHostFragment.addOnToolbarChangedListener

This API should be all you need for the event.
If you don’t know how Android event listener works, I would highly recommend reading on Android official documentation on that as it will be outside of scope of PDFTron support.

Thanks.

I had try implement like image but not working?


How to can make it working like onToolbarOptionsItemSelected

What I see there is not what I suggested. In any case, your coworker has sent yet another support request on this topic (3rd one now), we will continue there…

Yes, I will Because my project paid for a PDFTron license so I hope can implement it quickly to can release it. Because all member of my team is not experient with native android so I hope you can support me, thanks to you.

I think we will discuss thread on page https://support.pdftron.com/ I had create ticket on this

Please find sample code here:

Demo:

Please give it a try, thanks.

Thanks for the support, I implemented the code and it works. Thanks you so much!