Android Plugin Touch Issues with ForwardNativeEventsToDalvik

Hello.

I’m making an simple android plugin that adds a native image view to unity player activity in some specific events.

At the first time, it wasn’t touchable after Unity 4.3.x version. So I set ‘ForwardNativeEventsToDalvik’ to true in Manifest.xml. It became touchable.

However, when I touch an image view on the unity game, it touch the unity objects behind of the image view too. I want to let my users touch only the android image view, not unity objects. I think the unity for android forwards touch event to both native ui and its own game objects at the same time. It never happens in iOS.

I guess it might not happen until unity 4.3.x…

Do you guys know how to fix this issue?

Thanks in advance!

The answer goes the same as in this question:

"You have two possible solutions here:

  • create a separate window for your view, for example a Dialog;
  • create your own activity which shows your view.

The reason is that UnityPlayerNativeActivity consumes all these events, because the input loop is associated with Unity window."