Created
September 27, 2016 22:13
-
-
Save roblav96/b05fb93c89503fe75b2f4bb997657ff6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @JavaProxy('com.tns.NativeScriptActivity') | |
| class Activity extends android.app.Activity { | |
| private _callbacks: frame.AndroidActivityCallbacks | |
| onCreate(savedInstanceState: android.os.Bundle): void { | |
| if (!this._callbacks) { | |
| (<any>frame).setActivityCallbacks(this) | |
| } | |
| this._callbacks.onCreate(this, savedInstanceState, super.onCreate) | |
| } | |
| onRequestPermissionsResult(requestCode: number, permissions: Array<String>, grantResults: Array<number>): void { | |
| /*=========================================================================================== | |
| = I DIDNT KNOW CALLING super.onRequestPermissionsResult WAS MANDATORY = | |
| ===========================================================================================*/ | |
| this._callbacks.onRequestPermissionsResult(this, requestCode, permissions, grantResults, super.onRequestPermissionsResult) | |
| } | |
| onNewIntent(intent: android.content.Intent): void { | |
| let data: string = intent.getDataString() | |
| if (typeof data == 'string') { | |
| let url: Url = parse(data, true) | |
| LifeService.getEmitter().emit('url', url) | |
| } | |
| super.onNewIntent(intent) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment