Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit 5e55698

Browse files
author
Vasil Chimev
authored
docs(android): update code snippets of the extend-application-activity article (#1237)
1 parent fa1d3b1 commit 5e55698

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

docs/core-concepts/android-runtime/advanced-topics/extend-application-activity.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ The following steps are needed to create custom native `android.app.Application`
2626
2. Declare the extend:
2727

2828
```javascript
29-
var application = require("application");
29+
const superProto = android.app.Application.prototype;
3030

31-
var superProto = android.app.Application.prototype;
3231
// the first parameter of the `extend` call defines the package and the name for the native *.JAVA file generated.
33-
var Application = android.app.Application.extend("org.myApp.Application", {
32+
android.app.Application.extend("org.myApp.Application", {
3433
onCreate: function() {
3534
superProto.onCreate.call(this);
3635

@@ -46,12 +45,10 @@ The following steps are needed to create custom native `android.app.Application`
4645
});
4746
```
4847
```typescript
49-
import * as application from "application";
50-
5148
// the `JavaProxy` decorator specifies the package and the name for the native *.JAVA file generated.
5249
@JavaProxy("org.myApp.Application")
5350
class Application extends android.app.Application {
54-
protected onCreate(): void {
51+
onCreate(): void {
5552
super.onCreate();
5653
5754
// At this point modules have already been initialized
@@ -91,10 +88,10 @@ The core modules ship with a default `android.app.Activity` implementation, whic
9188
2. Declare the extend:
9289

9390
```javascript
94-
var frame = require("ui/frame");
91+
const frame = require("ui/frame");
9592
96-
var superProto = android.app.Activity.prototype;
97-
var Activity = android.app.Activity.extend("org.myApp.MainActivity", {
93+
const superProto = android.app.Activity.prototype;
94+
android.app.Activity.extend("org.myApp.MainActivity", {
9895
onCreate: function(savedInstanceState) {
9996
if(!this._callbacks) {
10097
frame.setActivityCallbacks(this);

0 commit comments

Comments
 (0)