Advertisement
vovan333

Toaster.java

Oct 26th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package com.asmjs.stealthcam;
  2.  
  3. import android.app.Activity;
  4. import android.widget.Toast;
  5.  
  6. public class Toaster
  7. {
  8.     public int ToastDuration = Toast.LENGTH_LONG;
  9.     private Activity CurrentActivity;
  10.  
  11.     public Toaster(Activity activity, int toastDuration)
  12.     {
  13.         ToastDuration = toastDuration;
  14.         CurrentActivity = activity;
  15.     }
  16.  
  17.     public Toaster(Activity activity)
  18.     {
  19.         CurrentActivity = activity;
  20.     }
  21.  
  22.     public void Toast(String message, int duration)
  23.     {
  24.         Toast toast = Toast.makeText(CurrentActivity.getApplicationContext(), message, duration);
  25.         toast.show();
  26.     }
  27.  
  28.     public void Toast(String message)
  29.     {
  30.         Toast(message, ToastDuration);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement