Skip to content

Commit a781fd4

Browse files
committed
refactor
1 parent 202735f commit a781fd4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/dove/flyer/demo2/ToastCustomModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public String getName() {
2222
}
2323

2424
@ReactMethod
25-
public void showMessage() {
25+
public void showMessage(String message) {
2626
finish();
27-
Toast.makeText(getReactApplicationContext(), "message", Toast.LENGTH_LONG).show();
27+
Toast.makeText(getReactApplicationContext(), message, Toast.LENGTH_LONG).show();
2828
}
2929

3030
public void finish() {

index.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
NativeModules
1010
} from 'react-native';
1111

12-
var RCTToastAndroid = NativeModules.ToastAndroid;
12+
var RCTToastAndroid = NativeModules.CustomToast;
1313

1414
class HelloWorld extends React.Component {
1515

@@ -27,7 +27,7 @@ class HelloWorld extends React.Component {
2727
// var RCTToastAndroid = require('NativeModules').ToastPunchh
2828
// RCTToastAndroid.showMessage();
2929
// debugger;
30-
RCTToastAndroid.show('Awesome', ToastAndroid.SHORT);
30+
RCTToastAndroid.show('Awesome');
3131

3232
}
3333

0 commit comments

Comments
 (0)