Correctly open urls in browser on Android 11+

- Fix misconfiguration in manifest ('http|https|market' is not valid)
- Split ShareUtils functions taking a boolean parameter into pairs of functions with better names and less runtime checks
- Move all Kore-related functions to KoreUtils
- Remove the toast_no_player string
This commit is contained in:
Stypox 2023-02-23 23:38:20 +01:00
parent e0cb2892b8
commit 600ebdae18
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
83 changed files with 125 additions and 267 deletions

View file

@ -1,6 +1,5 @@
package us.shandian.giga.ui.adapter;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_GRANT_PREFIX_URI_PERMISSION;
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
import static us.shandian.giga.get.DownloadMission.ERROR_CONNECT_HOST;
@ -345,16 +344,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
intent.setDataAndType(resolveShareableUri(mission), mimeType);
intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(FLAG_GRANT_PREFIX_URI_PERMISSION);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
}
if (intent.resolveActivity(mContext.getPackageManager()) != null) {
ShareUtils.openIntentInApp(mContext, intent, false);
} else {
Toast.makeText(mContext, R.string.toast_no_player, Toast.LENGTH_LONG).show();
}
ShareUtils.openIntentInApp(mContext, intent);
}
private void shareFile(Mission mission) {