意图软件详情页面 [英] Intent for app details page

查看:123
本文介绍了意图软件详情页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在很大程度上依赖于对数据的数据库,有时数据库将无法正确复制,被损坏,或者只是抛出一个通用的滑索。清除应用程序数据,然后重新打开应用程序似乎运作良好,但它是很繁琐的事要问我的用户通过挖设置页面,我正在寻找一种方式,迅速得到了应用程序的详细信息页面(其显示卸载,移至SD,清晰的数据等。)

我已经找到了<一href="http://developer.android.com/reference/android/provider/Settings.html#ACTION_APPLICATION_DETAILS_SETTINGS"相对=nofollow> Settings.ACTION_APPLICATION_DETAILS_SETTINGS 意向行动,但得到的 ActivityNotFoundException 当我尝试推出它描述了我的欲望Z.谁能帮助我了解如何正确地分类吗?

感谢

编辑:在回答指出,这仅仅是API9以上,code我现在用的,如果有人想这是下文。相信它适用于API3以上。

 尝试{

    意图I =新的意图(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    i.setData(Uri.parse(套餐:com.espian.formulae));
    startActivity(ⅰ);

}赶上(ActivityNotFoundException前){

    意图I =新的意图(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    startActivity(ⅰ);

}
 

解决方案

我会后它作为答案这里除了我的评论。这一意图仅作为API 9级(2.3)的。在Desire Z的没有2.3 ...还没有。 ;)

My app relies heavily on a database for data and sometimes the database won't copy correctly, gets corrupted, or just throws a generic strop. Clearing the app data and then reopening the app seems to work well, but it's quite a chore to ask my users to dig through the settings pages, and I'm looking for a way to quickly get to the app details page (which shows the uninstall, move to SD, clear data etc.)

I've found the Settings.ACTION_APPLICATION_DETAILS_SETTINGS Intent action but get an ActivityNotFoundException when I try to launch it as described on my Desire Z. Can anyone help me out how to properly sort this?

Thanks

EDIT: As noted in the answers, this is only API9 and above, the code I now use if anyone wants it is below. Believe it works on API3 and above.

try {

    Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    i.setData(Uri.parse("package:com.espian.formulae"));
    startActivity(i);

} catch (ActivityNotFoundException ex) { 

    Intent i = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    startActivity(i);

}

解决方案

I'll post it as answer here in addition to my comment. That intent is only available as of API Level 9 (2.3). The Desire Z doesn't have 2.3... yet. ;)

这篇关于意图软件详情页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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