Add support for Android Activity

- Add support for Android Activity
- Fix misplaced pointer
- Sync with Java platform source