18034727885
2026-04-27 3a4c1bbb2cf4fb1cdda8a5061b0674f30e7456b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.example.basecore.util;
 
import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
 
import java.util.List;
 
 
public class SchemeUtils {
 
 
    public static final String rootUrl = "xll-jct-app://page";
 
 
    private static final String appScheme = "xll-jct-app";
 
    public static boolean openScheme(Context ctx, String scheme) {
        openScheme(ctx, scheme, null);
 
        return true;
    }
 
 
    /**
     * 过渡动画
     */
    public static boolean openSchemeWithTrans(Activity activity, String scheme) {
        openScheme(activity, scheme, ActivityOptions.makeSceneTransitionAnimation(activity).toBundle());
 
        return true;
    }
 
 
    public static boolean openScheme(Context ctx, String scheme, Bundle bundle) {
        if (TextUtils.isEmpty(scheme) || TextUtils.isEmpty(scheme.trim()) || "null".equalsIgnoreCase(scheme)) {
            return false;
        }
        Uri uri = Uri.parse(scheme);
        if (uri != null) {
            String sc = uri.getScheme();
            if (!appScheme.equalsIgnoreCase(sc)) {
                return false;
            }
        }
 
        if (ctx == null) {
            return false;
        }
 
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 
        if (bundle != null) {
            ctx.startActivity(intent, bundle);
        } else {
            ctx.startActivity(intent);
        }
 
        return true;
    }
 
 
    public static boolean openSchemeWithParam(Context ctx, String scheme, Bundle bundle) {
        if (TextUtils.isEmpty(scheme) || TextUtils.isEmpty(scheme.trim()) || "null".equalsIgnoreCase(scheme)) {
            return false;
        }
        Uri uri = Uri.parse(scheme);
        if (uri != null) {
            String sc = uri.getScheme();
            if (!appScheme.equalsIgnoreCase(sc)) {
                return false;
            }
        }
 
        if (ctx == null) {
            return false;
        }
 
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 
        intent.putExtra("bundle", bundle);
 
        ctx.startActivity(intent);
 
        return true;
    }
 
}