update android toast; issue #13

This commit is contained in:
iddoeldor 2020-05-20 17:14:51 +03:00 committed by GitHub
parent 88d288a327
commit 64b54be7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1010,14 +1010,10 @@ TODO
#### Android make Toast #### Android make Toast
```js ```js
Java.scheduleOnMainThread(function() { // 0 = // https://developer.android.com/reference/android/widget/Toast#LENGTH_LONG
Java.use("android.widget.Toast") Java.scheduleOnMainThread(() => {
.makeText( Java.use("android.widget.Toast")
Java.use("android.app.ActivityThread").currentApplication().getApplicationContext(), .makeText(Java.use("android.app.ActivityThread").currentApplication().getApplicationContext(), Java.Use("java.lang.StringBuilder").$new("Text to Toast here"), 0).show();
"Text to Toast here",
0 // https://developer.android.com/reference/android/widget/Toast#LENGTH_LONG
)
.show();
}); });
``` ```