Is there a way to get current process name in Android

后端 未结 11 1804
-上瘾入骨i
-上瘾入骨i 2020-12-03 00:59

I set an Android:process=\":XX\" for my particular activity to make it run in a separate process. However when the new activity/process init, it will call my Application:onC

11条回答
  •  爱一瞬间的悲伤
    2020-12-03 01:35

    The main process's father process should be zygote, this should be the accurate solution

    1. first judge the process's name from /proc/pid/cmdline which should equal to package name
    2. judge the process's father whether Zygote(why do this? because some APP have different processes with same name)

提交回复
热议问题