[Android] Add validation for get navigation item

If the input parameter is out of scope, it will cause crash.
Add validation here to avoid crash.

BUG=XWALK-1863