English 中文(简体)
如何了解从另一个和海底应用中可以读取的可能参数
原标题:How to know possible parameters readable from another android application

开始申请的Im在安乐器上安装了应用程序。

基本上,这部法典是用来启动由本人提出的另一项申请,其参数是参数。

申请1:

PackageManager pm = getApplicationContext().getPackageManager();
Intent appStartIntent = pm.getLaunchIntentForPackage(mypackage);
    appStartIntent.putExtra("message", s);

    if (null != appStartIntent) {
        getApplicationContext().startActivity(appStartIntent);
    }

在我的其他申请中,我如何得出参数:

Appliaction 2 :

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Bundle extras = getIntent().getExtras(); 
    String result;
    try {
        result= (String) extras.getString("message");
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        recup = "nothing received";
    }

    Toast.makeText(getApplicationContext(), recup, Toast.LENGTH_SHORT).show();
}

这里的问题是,我们需要知道第二份申请能够得到一个称为“mes”的参数。

Here is the question : Is it possible to know all possible parameters expected by the application 2, from the application 1 ? If yes, is it possible to know for example, the parameters accepted by any installed application on my phone? (example : Handcent, Facebook, latitude...)

最佳回答

Androidt界定了元数据预报,使您能够检索预期应用参数。 因此,不可能做你想要做的事情。 您将不得不依靠每项申请的文件。

问题回答

对我来说,这是我所知的最佳方式是使目标应用脱节,并观察所期望的活动。

你可以尝试在课堂内进行反思,并掌握其方法和预期参数。 不能确定这是否完全解决了你的问题,而是开始......





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签