Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

华为 mate30 Android 下选择视频 路径返回null #223

Open
gonganruyi opened this issue Nov 8, 2021 · 2 comments
Open

华为 mate30 Android 下选择视频 路径返回null #223

gonganruyi opened this issue Nov 8, 2021 · 2 comments

Comments

@gonganruyi
Copy link

华为 mate30 Android 下选择视频 路径返回null

@kangfenmao
Copy link
Contributor

问题1

image

问题2

Boolean isAndroidQ = SdkVersionUtils.isQ();
Boolean isAndroidR = SdkVersionUtils.isR();

String filePath = media.getPath();

if (isAndroidQ) {
    filePath = media.getAndroidQToPath();
}

if (isAndroidR){
    filePath = media.getRealPath();
}

工具类

io.github.lucksiege:pictureselector:v2.7.3-rc10 中找到了这个,旧版本没有判断 androidR 的方法

SdkVersionUtils.java

package com.syanpicker;

import android.os.Build;

/**
 * @author:luck
 * @date:2019-07-17 15:12
 * @describe:Android Sdk版本判断
 */
public class SdkVersionUtils {
    /**
     * 判断是否是Android Q版本
     *
     * @return
     */
    public static boolean isQ() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;
    }

    /**
     * 判断是否是Android R版本
     *
     * @return
     */
    public static boolean isR() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
    }
}

@gonganruyi @syanbo

@caijiami
Copy link

问题1

图像

问题2

Boolean isAndroidQ = SdkVersionUtils.isQ();
Boolean isAndroidR = SdkVersionUtils.isR();

String filePath = media.getPath();

if (isAndroidQ) {
    filePath = media.getAndroidQToPath();
}

if (isAndroidR){
    filePath = media.getRealPath();
}

工具类

io.github.lucksiege:pictureselector:v2.7.3-rc10 中找到了这个,旧版本没有判断 androidR 的方法

SdkVersionUtils.java

package com.syanpicker;

import android.os.Build;

/**
 * @author:luck
 * @date:2019-07-17 15:12
 * @describe:Android Sdk版本判断
 */
public class SdkVersionUtils {
    /**
     * 判断是否是Android Q版本
     *
     * @return
     */
    public static boolean isQ() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q;
    }

    /**
     * 判断是否是Android R版本
     *
     * @return
     */
    public static boolean isR() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
    }
}

@gonganruyi @syanbo
大佬 工具类io.github.lucksiege:pictureselector:v2.7.3-rc10 在哪里啊,没找到啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants