download file and ask for permissions to write into storage

This commit is contained in:
M M Arif
2020-03-08 12:46:31 +05:00
parent 3794d7ff2b
commit 181a94edbe
4 changed files with 115 additions and 38 deletions

View File

@@ -28,4 +28,19 @@ public class Toasty {
}
public static void error(Context context, String message) {
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate( context.getResources().getLayout(R.layout.custom_toast_error), null );
TextView text = view.findViewById(R.id.toastText);
text.setText(message);
Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(view);
toast.show();
}
}