如何检查我的应用程序是否在android中设置为默认? [英] How to check if my application is set default or not in android?

查看:60
本文介绍了如何检查我的应用程序是否在android中设置为默认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查我的应用程序是否设置为我在App内部处理的Intent的默认应用程序.

I want to check if my application is set as the default application for the Intents I'm handling inside my App.

例如,ff一个以上的应用程序支持打开指定的文件格式.我需要根据我的代码将我的应用程序设置为默认应用程序.如何使我的应用程序成为默认值(根据代码)?谁能帮我?

As an example ff more than one application supports to open a specified file format. I need to make my application as a default application from my code. How it possible to make my application a default (from the code)? Can anyone help me?

如果我的应用未在设备上设置为默认设置,至少我想在启动应用时进行检查,并重定向用户以填写一些信息.

At least I would like to check this on startup of my app and redirect the user to fill in some information if my App is not set as the default on the device.

推荐答案

据我所知这是不可能的.该对话由系统处理-仅当用户从列表中选择您的应用时,您的应用才会启动.

As far as I know this is not possible. That dialogue is handled by the system - your app will only be launched if the user picks your app from the list.

允许这种行为将影响用户控制其默认应用程序的能力,并且从技术角度来看,这意味着每次出现此类列表时,都必须将进程及其内存分配给列表中的每个应用程序.

Allowing such a behaviour would impact the user's ability to control their default applications, and from a technical point of view would mean a process and its memory would have to be allocated to every app in the list every time such a list appeared.

这篇关于如何检查我的应用程序是否在android中设置为默认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆