I have an android library project and imported the library project in the Unity project. Now, I want to implement a callback in Unity project, which will execute according t
I believe you are only allowed to call UnitySendMessage() from the main thread - at least in one scenario above you are calling it from the Android UI worker thread.
As a quick sanity test, try calling it before you right at the top of your shareText() function.