Example usage for android.content Context getString

List of usage examples for android.content Context getString

Introduction

In this page you can find the example usage for android.content Context getString.

Prototype

@NonNull
public final String getString(@StringRes int resId) 

Source Link

Document

Returns a localized string from the application's package's default string table.

Usage

From source file:Main.java

public static void showToastShort(Context context, int text) {
    Toast.makeText(context, context.getString(text), Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static String getDefaultDatabaseName(Context context) {
    return DATABASE_START + context.getString(context.getApplicationInfo().labelRes) + DATABASE_TYPE;
}

From source file:Main.java

public static String getStringSetting(int settingId, Context context) {
    return preferences(context).getString(context.getString(settingId), null);
}

From source file:Main.java

public static void showToast(final Context c, int resId) {
    String text = c.getString(resId);
    showToast(c, text);/*from w w  w  .  ja  v  a2s .  com*/
}

From source file:Main.java

public static void ShowToast(Context context, int nStringId) {
    ShowToast(context, context.getString(nStringId));
}

From source file:Main.java

public static void showToastShort(Context ctx, int rid) {
    Toast.makeText(ctx, ctx.getString(rid), Toast.LENGTH_SHORT).show();
}

From source file:Main.java

public static void showToastLong(Context ctx, int rid) {
    Toast.makeText(ctx, ctx.getString(rid), Toast.LENGTH_LONG).show();
}

From source file:Main.java

public static void showProgressDialog(Context c, int resId) {
    dialog = ProgressDialog.show(c, "", c.getString(resId));
}

From source file:Main.java

public static void showToast(Context context, int contentid) {
    showToast(context, context.getString(contentid), false);
}

From source file:Main.java

/**
 * Show a Toast message/* w  ww.java2  s  . c o  m*/
 * @param context The context
 * @param strId The string resource id
 */
public static void showToast(Context context, int strId) {
    showToast(context, context.getString(strId));
}