Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context ===> context.getApplicationContext() #23

Merged
merged 1 commit into from
May 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ToastUtil {
*/
public static void showShort(Context context, CharSequence message) {
if (null == toast) {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
toast = Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_SHORT);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand All @@ -37,7 +37,7 @@ public static void showShort(Context context, CharSequence message) {
*/
public static void showShort(Context context, int message) {
if (null == toast) {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
toast = Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_SHORT);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand All @@ -53,7 +53,7 @@ public static void showShort(Context context, int message) {
*/
public static void showLong(Context context, CharSequence message) {
if (null == toast) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
toast = Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_LONG);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand All @@ -69,7 +69,7 @@ public static void showLong(Context context, CharSequence message) {
*/
public static void showLong(Context context, int message) {
if (null == toast) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
toast = Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_LONG);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand All @@ -86,7 +86,7 @@ public static void showLong(Context context, int message) {
*/
public static void show(Context context, CharSequence message, int duration) {
if (null == toast) {
toast = Toast.makeText(context, message, duration);
toast = Toast.makeText(context.getApplicationContext(), message, duration);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand All @@ -108,7 +108,7 @@ public static void show(Context context, CharSequence message) {
*/
public static void show(Context context, int message, int duration) {
if (null == toast) {
toast = Toast.makeText(context, message, duration);
toast = Toast.makeText(context.getApplicationContext(), message, duration);
// toast.setGravity(Gravity.CENTER, 0, 0);
} else {
toast.setText(message);
Expand Down