Commit b28d4e2d authored by fallenstardust's avatar fallenstardust

fix makeText

parent 270be334
...@@ -226,8 +226,7 @@ public class GameUriManager { ...@@ -226,8 +226,7 @@ public class GameUriManager {
if ("file".equals(uri.getScheme()) || "content".equals(uri.getScheme())) { if ("file".equals(uri.getScheme()) || "content".equals(uri.getScheme())) {
File file = toLocalFile(uri); File file = toLocalFile(uri);
if (file == null || !file.exists()) { if (file == null || !file.exists()) {
YGOUtil.showTextToast("open file error"); YGOUtil.showTextToast("open file error", Toast.LENGTH_LONG);
Toast.makeText(activity, "open file error", Toast.LENGTH_LONG).show();
return; return;
} }
boolean isYdk = file.getName().toLowerCase(Locale.US).endsWith(YDK_FILE_EX); boolean isYdk = file.getName().toLowerCase(Locale.US).endsWith(YDK_FILE_EX);
......
...@@ -41,8 +41,7 @@ public class YGOUtil { ...@@ -41,8 +41,7 @@ public class YGOUtil {
} }
public static void showTextToast(int gravity, String message, int duration) { public static void showTextToast(int gravity, String message, int duration) {
Toast toast = new Toast(App.get()); Toast toast = Toast.makeText(App.get(), message, duration);
toast.setDuration(duration);
toast.setGravity(gravity,0, 0); toast.setGravity(gravity,0, 0);
toast.setText(message); toast.setText(message);
toast.show(); toast.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment