Can i get the process Id of an messaging activity? and also using this can i start that partic开发者_开发问答ular activity.
You must be looking for Messaging Intent not process id.
Eg: startActivity(com.android.mms)
One solution that isn't pretty is to use Activity manager and go through all the Running app processes searching for that messaging app.
ActivityManager manager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        List<ActivityManager.RunningAppProcessInfo> processes = manager
                .getRunningAppProcesses();
        for (RunningAppProcessInfo process : processes) {
                String name = process.processName;
                if (name.contains(MESSAGING_APP_NAME) {
                    return process.pid;
                }
        }
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论