Open another one application from our application?

后端 未结 3 1649
旧巷少年郎
旧巷少年郎 2021-01-13 04:21

From my application i have to open a another one application.Is there any possibility to open like this?

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 05:08

    Probably you are looking for a way to start another class from another package

    Intent myIntent = new Intent();
    myIntent.setClassName("com.android.samples", "com.android.samples.Animation1");
    myIntent.putExtra("com.android.samples.SpecialValue", "Hello, Joe!"); // key/value pair, where key needs current package prefix.
    startActivity(myIntent);    
    

    Read a tutorial post about Opening a Screen at Common Tasks post.

提交回复
热议问题