安卓:可以从我自己的启动其他应用程序的任何活动?

问题描述:

这是一个Android noob问题。

This is an Android noob question.

我想通过自己的应用程序启动的另一个APK活动。现在我知道我可以启动任何其他应用程序,并调用它的主要活动。在许多情况下,我也能启动子活动,例如显示它的设置对话框。 然而,随着一些应用,比如Facebook或Endomondo我会得到一个FC每次我尝试推出自己的应用程序的一些具体活动。

I am trying to start an activity of another apk through my own application. Now I know I can launch any other application and invoke its main activity. In many cases I'm also able to start subactivities, for example display it's settings dialogue. However with some applications, for example Facebook or Endomondo I would get a FC everytime I try to launch some specific activity of their application.

现在我怀疑这是一个权限问题,而且Facebook或Endomondo开发者只是不希望其他应用程序可以访问他们的活动。但是,我必须找出哪些活动,我可以使用,哪些我无法通过试用和错误每一次?

Now I suspect that this is a permission issue and that the Facebook or Endomondo devs just don't want other applications to get access to their activities. But do I have to find out which activities I can use and which ones I can't use by trial and error every single time?

另外:有没有解决这个困境什么办法?也许在一个有根的设备?

Plus: Is there any way around this dilemma? Maybe on a rooted device?

干杯的任何指针。

正如你已经说你只能使用其目的是要使用的其他应用程序等应用程序的活动。通常情况下,其他应用程序的开发者定义一套意图和行动的他们的应用程序将能够理解和处理。

As you already said you can only use activities of other apps which are designed to be used by others applications. Normally the developer of the other app define a set of intents and actions their app will be able to understand and process.

使用其他应用程序的活动是在默认情况下不可能的,这是Android系统的设计为每一个应用程序运行在它自己的沙盒进程(也有一些例外情况的应用程序可以共享的过程)。

Using any other app's activity is by default not possible, this is by design of Android as every app runs in it own sandboxed process (there are some exceptions where apps can share a process).

因此​​,要使用另一个应用程序的活动,你必须知道的意图是监听。通常,这可以在应用程序的网站或文档或 OpenIntents软件一个字典意图。

So to use another app's activities you must know the intents it listen on. Normally this can be found in the applications website or documentation or on OpenIntents a dictionary for intents.