I have a keyboard, I want to make it easier to share. As if in the current application in which I find myself sending an Intent, and not choosing from the list of installed ones. This code is not exactly what you need

mPackageName = mActivityManager.getRunningAppProcesses().get(0).processName; 
  • As far as I know, starting from a certain version (4.4 chtoli) it is impossible to get a list of running applications. - Vladyslav Matviienko

0