Skip to content

Commit 9ae3fb4

Browse files
committed
using ApplicationContext for ToastLess for delay avoiding toast leak
1 parent 8103313 commit 9ae3fb4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lesscode-core/src/main/java/com/jayfeng/lesscode/core/ToastLess.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
public final class ToastLess {
1010

1111
public static void $(Context context, String message) {
12-
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
12+
Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_SHORT).show();
1313
};
1414

1515
public static void $(Context context, int stringId) {
16-
Toast.makeText(context, stringId, Toast.LENGTH_SHORT).show();
16+
Toast.makeText(context.getApplicationContext(), stringId, Toast.LENGTH_SHORT).show();
1717
};
1818

1919
}

0 commit comments

Comments
 (0)