开发者

Discovering URI of intents

I have been reading quite a bit about intents and the like, and have been trying to avoid having to actually post a question. I believe what happens is you set the URI and that passes data to an intent (please correct me if I'm wrong), I am interested in using the calculator app on the phone, but I don't know HOW to de开发者_如何学Pythontermine what URI's are available of a given package (assuming URI is the correct terminology). (I'd be happy with only android native apps or any "open" apps).


The Intents List: Google Apps has what I think you're asking for.


I got this solution from the DroidFu library

    public static boolean isIntentAvailable(Context context, String action, Uri uri, String mimeType) {
    final Intent intent = (uri != null) ? new Intent(action, uri) : new Intent(action);
    if (mimeType != null) {
        intent.setType(mimeType);
    }
    List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent,
        PackageManager.MATCH_DEFAULT_ONLY);
    return !list.isEmpty();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜