我的应用程序显示了移动设备的后台运行应用程序列表。当我的应用程序在kitkat设备中运行时,它显示了后台应用程序列表,但是当它在marshmallow设备上运行时,它只显示当前应用程序,而不是更多。
主要活动如下
$gender = "";
<input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">Female
<input type="radio" name="gender" <?php if (isset($gender) && $gender=="male") echo "checked";?> value="male">Male
我在manifestast.xml中声明的权限是
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView) findViewById(R.id.text);
ActivityManager activityManager = (ActivityManager) this
.getSystemService(ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> procInfos = activityManager
.getRunningAppProcesses();
for (int idx = 0; idx < procInfos.size(); idx++) {
tv.setText(tv.getText() + "" + (idx + 1) + "."
+ procInfos.get(idx).processName + "\n");
}
}}