Search in sources :

Example 86 with Toast

use of android.widget.Toast in project BaseProject by feer921.

the class ToastUtil method showToast.

public static void showToast(int strID) {
    Toast mToast = new Toast(mContext);
    View v = layoutInflater.inflate(R.layout.layout_toast, null);
    TextView messageInfo = (TextView) v.findViewById(R.id.toast_info);
    messageInfo.setText(strID);
    mToast.setView(v);
    mToast.setGravity(Gravity.BOTTOM, 0, 8);
    mToast.setDuration(300);
    mToast.show();
}
Also used : Toast(android.widget.Toast) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 87 with Toast

use of android.widget.Toast in project BaseProject by feer921.

the class ToastUtil method showToast.

public static void showToast(String str) {
    Toast mToast = new Toast(mContext);
    View v = layoutInflater.inflate(R.layout.layout_toast, null);
    // TextView messageInfo = (TextView) v.findViewById(R.id.toast_info);
    // messageInfo.setText(str);
    mToast.setView(v);
    mToast.setGravity(Gravity.BOTTOM, 0, 8);
    mToast.setDuration(300);
    mToast.show();
}
Also used : Toast(android.widget.Toast) TextView(android.widget.TextView) View(android.view.View)

Example 88 with Toast

use of android.widget.Toast in project xDrip by NightscoutFoundation.

the class Home method toast.

public void toast(final String msg) {
    try {
        Context context = getApplicationContext();
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        toast.show();
        Log.d(TAG, "toast: " + msg);
    } catch (Exception e) {
        Log.d(TAG, "Couldn't display toast: " + msg + " / " + e.toString());
    }
}
Also used : Context(android.content.Context) Toast(android.widget.Toast) ActivityNotFoundException(android.content.ActivityNotFoundException)

Example 89 with Toast

use of android.widget.Toast in project xDrip-plus by jamorham.

the class Home method toast.

public void toast(final String msg) {
    try {
        Context context = getApplicationContext();
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        toast.show();
        Log.d(TAG, "toast: " + msg);
    } catch (Exception e) {
        Log.d(TAG, "Couldn't display toast: " + msg + " / " + e.toString());
    }
}
Also used : Context(android.content.Context) Toast(android.widget.Toast) ActivityNotFoundException(android.content.ActivityNotFoundException)

Example 90 with Toast

use of android.widget.Toast in project android_packages_apps_Settings by omnirom.

the class WebViewUpdateServiceWrapper method showInvalidChoiceToast.

/**
 * Show a toast to explain the chosen package can no longer be chosen.
 */
public void showInvalidChoiceToast(Context context) {
    // The user chose a package that became invalid since the list was last updated,
    // show a Toast to explain the situation.
    Toast toast = Toast.makeText(context, R.string.select_webview_provider_toast_text, Toast.LENGTH_SHORT);
    toast.show();
}
Also used : Toast(android.widget.Toast)

Aggregations

Toast (android.widget.Toast)485 Context (android.content.Context)89 View (android.view.View)86 TextView (android.widget.TextView)74 Intent (android.content.Intent)55 Rect (android.graphics.Rect)34 LayoutInflater (android.view.LayoutInflater)31 SuppressLint (android.annotation.SuppressLint)30 JSONObject (org.json.JSONObject)23 ImageView (android.widget.ImageView)21 RequestQueue (com.android.volley.RequestQueue)20 Response (com.android.volley.Response)20 EditText (android.widget.EditText)19 JSONException (org.json.JSONException)18 VolleyError (com.android.volley.VolleyError)17 JsonObjectRequest (com.android.volley.toolbox.JsonObjectRequest)17 User (model.User)16 PendingIntent (android.app.PendingIntent)15 File (java.io.File)15 HashMap (java.util.HashMap)15