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

EditorInfoCompat.getContentMimeTypes(editorInfo); #7

Open
WelconeHuang opened this issue Jul 4, 2018 · 0 comments
Open

EditorInfoCompat.getContentMimeTypes(editorInfo); #7

WelconeHuang opened this issue Jul 4, 2018 · 0 comments
Labels
migrated googlesamples Migrated from old googlesamples repos

Comments

@WelconeHuang
Copy link

when running to this method, it always returns an empty array:

private boolean isCommitContentSupported(
@nullable EditorInfo editorInfo, @nonnull String mimeType) {
if (editorInfo == null) {
return false;
}

    final InputConnection ic = getCurrentInputConnection();
    if (ic == null) {
        return false;
    }

    if (!validatePackageName(editorInfo)) {
        return false;
    }

    final String[] supportedMimeTypes = EditorInfoCompat.getContentMimeTypes(editorInfo);// Here is the empty array, and results in false return 


    for (String supportedMimeType : supportedMimeTypes) {
        if (ClipDescription.compareMimeTypes(mimeType, supportedMimeType)) {
            return true;
        }
    }
    return false;
}

I'm running on an Android 8 device

@codingjeremy codingjeremy transferred this issue from googlearchive/android-CommitContentSampleIME Sep 16, 2019
@codingjeremy codingjeremy added the migrated googlesamples Migrated from old googlesamples repos label Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated googlesamples Migrated from old googlesamples repos
Projects
None yet
Development

No branches or pull requests

2 participants