nativescript-android-toast
Toast Plugin for Nativescript Android Devices
npm i --save nativescript-android-toast

Nativescript Android Toast

npm GitHub Build Status npm GitHub issues Status Twitter Follow

Installation:

tns plugin add nativescript-android-toast


API (Methods)

MakeToast(text : String, duration : "long" or "short");

API (Properties)

Property Type Require Description
text String Required Text you want to toast
duration String Optional "long" or "short" duration

Demo

Demo 1 Demo 2
Demo 1 Demo 2

Usage

TypeScript

import Toast from "nativescript-android-toast";

showToast() {
Toast.MakeToast("Hello Typescript","short");
}

<Button text="click" (tap)="showToast();">

JavaScript

var Toast = require("nativescript-android-toast");

showToast() {
Toast.MakeToast("Hello Javascript","long");
}

https://developer.android.com/reference/android/widget/Toast