How to get Android application id?

后端 未结 13 646
失恋的感觉
失恋的感觉 2020-12-07 18:26

In Android, how do I get the application\'s id programatically (or by some other method), and how can I communicate with other applications using that id?

13条回答
  •  借酒劲吻你
    2020-12-07 18:39

    Else you can get id of process your application runs in:

    final static int android.os.Process.myPid()
    Returns the identifier of this process, which can be used with killProcess(int) and sendSignal(int, int).

提交回复
热议问题