@@ -15,22 +15,23 @@ private ToastUtils() {
1515 throw new AssertionError ();
1616 }
1717
18- public static void showToast (Context context , int stringResId ) {
19- showToast (context , stringResId , Duration .SHORT );
18+ public static Toast showToast (Context context , int stringResId ) {
19+ return showToast (context , stringResId , Duration .SHORT );
2020 }
2121
22- public static void showToast (Context context , int stringResId , Duration duration ) {
23- showToast (context , context .getString (stringResId ), duration );
22+ public static Toast showToast (Context context , int stringResId , Duration duration ) {
23+ return showToast (context , context .getString (stringResId ), duration );
2424 }
2525
26- public static void showToast (Context context , String text ) {
27- showToast (context , text , Duration .SHORT );
26+ public static Toast showToast (Context context , String text ) {
27+ return showToast (context , text , Duration .SHORT );
2828 }
2929
30- public static void showToast (Context context , String text , Duration duration ) {
30+ public static Toast showToast (Context context , String text , Duration duration ) {
3131 Toast toast = Toast .makeText (context , text ,
3232 (duration == Duration .SHORT ? Toast .LENGTH_SHORT : Toast .LENGTH_LONG ));
3333 toast .setGravity (Gravity .CENTER , 0 , 0 );
3434 toast .show ();
35+ return toast ;
3536 }
3637}
0 commit comments