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:
parent
e0cb2892b8
commit
600ebdae18
83 changed files with 125 additions and 267 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue