Ignore(absorb) Raycast on Canvas in mobile

In Unity 4.6.1 we are trying to tap on a ui button and during tapping we are doing raycast . As a result the collider behind that ui button is detecting the tap .We want that the collider should not take tap when we tap on the ui button. we came across this solution but this doesnot work in mobile device (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()) .This is for mouse over we need for mouse tap

IsPointerOverGameObject should work on mobile devices, but it probably only checks the first touch contact.

Try using EventSystem.currentSelectedGameObject and checking if its null.