在Android中打开计算器 [英] Opening a Calculator in Android

查看:168
本文介绍了在Android中打开计算器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的活动中打开一个计算器.这是我的代码,现在可以使用了:

I'm looking to open a calculator from within my Activity. Here's my code right now and it works:

Intent i = new Intent();
i.setClassName("com.android.calculator2",
"com.android.calculator2.Calculator");

我想对此进行隐式调用,因为我不知道使用该计算器要使用什么计算器,并且我想让该选项保持打开状态以从计算器接收值,而android系统显然不这样做.做.我还没有找到一个很好的示例,说明如何隐式地请求一种类型的应用程序.

I would like to make this an implicit call because I don't know what calculator the use would like to use and I would like to leave the option open to receive a value from the calculator, which the android one apparently doesn't do. I haven't been able to find a good example of how to implicitly ask for a type of application.

我查看了 http://www.openintents.org/en/intentstable但我想我并不完全了解如何使用该网站.

I've looked at http://www.openintents.org/en/intentstable but I guess I don't completely understand how to use that site.

我想我了解意图的意图,但是也许我只是对如何使用它们没有把握.

I think I understand the intent of intents, but maybe I just don't have a firm grasp on how to use them.

推荐答案

您所拥有的可能是最好的.我只是在AndroidManifest.xml中检查了com.android.calculator2.Calculator,它没有侦听其他任何意图.

What you have is probably the best you can do. I just checked the AndroidManifest.xml for com.android.calculator2.Calculator and it doesn't listen for any other intents.

这篇关于在Android中打开计算器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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