package de.fu_berlin.cdv.chasingpictures.util;

import android.content.Context;
import android.support.annotation.StringRes;
import android.widget.Toast;

/**
 * Class that provides utility methods.
 *
 * @author Simon Kalt
 */
public class Utilities {

    /**
     *
     * @param context The current context
     * @param message The message to be displayed
     * @deprecated Use {@link #showError(Context, int)} if possible.
     */
    @Deprecated
    public static void showError(Context context, String message) {
        Toast.makeText(
                context,
                message,
                Toast.LENGTH_SHORT
        ).show();
    }

    /**
     * Displays an error to the user.
     * Currently does the same thing as {@link #showToast(Context, int)} but
     * could later be changed to look differently.
     *
     * @param context The current context
     * @param resID A string resource to be displayed
     */
    public static void showError(Context context, @StringRes int resID) {
        Toast.makeText(
                context,
                resID,
                Toast.LENGTH_SHORT
        ).show();
    }

    /**
     * Displays a message to the user.
     *
     * @param context The current context
     * @param resID A string resource to be displayed
     */
    public static void showToast(Context context, @StringRes int resID) {
        Toast.makeText(
                context,
                resID,
                Toast.LENGTH_SHORT
        ).show();
    }
}

@@ -246,17 +246,16 @@
 ities %7B%0A
-%0A
     /**%0A
@@ -317,23 +317,28 @@
  @param 
-message
+formatString
  The mes
@@ -354,24 +354,85 @@
 e displayed%0A
+     * @param args Arguments to be formatted into the string%0A
      * @depr
@@ -472,16 +472,27 @@
 ext, int
+, Object...
 )%7D if po
@@ -580,23 +580,44 @@
  String 
-message
+formatString, Object... args
 ) %7B%0A    
@@ -677,23 +677,49 @@
         
-message
+String.format(formatString, args)
 ,%0A      
@@ -888,16 +888,27 @@
 ext, int
+, Object...
 )%7D but%0A 
@@ -957,23 +957,16 @@
 rently.%0A
-     *%0A
      * @
@@ -1045,32 +1045,93 @@
 to be displayed%0A
+     * @param args Arguments to be formatted into the string%0A
      */%0A    publ
@@ -1184,32 +1184,48 @@
 ingRes int resID
+, Object... args
 ) %7B%0A        Toas
@@ -1224,122 +1224,38 @@
     
+show
 Toast
-.makeText(%0A                context,%0A                resID,%0A                Toast.LENGTH_SHORT%0A        ).show(
+(context, resID, args
 );%0A 
@@ -1307,23 +1307,16 @@
 e user.%0A
-     *%0A
      * @
@@ -1399,24 +1399,85 @@
 e displayed%0A
+     * @param args Arguments to be formatted into the string%0A
      */%0A    
@@ -1542,16 +1542,32 @@
 nt resID
+, Object... args
 ) %7B%0A    
@@ -1627,21 +1627,61 @@
         
-resID
+String.format(context.getString(resID), args)
 ,%0A      

Update error message display methods to take formatting arguments