Android:在任务列表隐藏最近打开的app

摘要:
//schemas.android.com/apk/res/android“package=”com.li.test“android:versionName=”1.0“&gt:targetSdkVersion=”23“/&gt:allowBackup=”true“android:icon=”@mipmap/ic_launcher“android:

对于某一个应用,如果不想在最近打开的app列表中留下任何纪录,即按下Home键回到主页,再按任务键的时候,任务列表看不到这个app,在AndroidManifest中给Activity标签添加:android:excludeFromRecents=”true”即可。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.li.test"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="23" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <activity 
            android:name=".MainActivity"
            android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

设置之后,按Home键,回到主页面。点击任务键,显示“无最近使用的应用程序”。如下图所示:
无最近使用的应用程序

免责声明:文章转载自《Android:在任务列表隐藏最近打开的app》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Mysql 查询以某个字符开头的语句说说接口封装下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Vue中使用openlayer做风场图

<template> <div class="box"> <div ref="emap" id="map"></div> <div id="popup" class="ol-popup"> <a href="#" id="popup-closer" class...

MATLAB 和 armadillo 数据转换

#include<iostream> #include<armadillo> int D=5; int M=4; int main() { arma::fmat x; x.randn(D,1); arma::fmat A; A.randn(M,D); std::cout<<"x= "<<x<...

Html辅助方法 之 Form表单标签

一、Html.BeginForm  <form>标签 //视图代码@using (Html.BeginForm("search", "home", FormMethod.Get),new { target="_black",@ }) { <input type="text" value="" /> }//生成的...

为什么国外的 App 很少会有开屏广告?

前言: 笔者在知乎看到这个问题,觉得这的确是一个值得关注和回答的现象,遂写了回答并整理成本文发布在此抛砖引玉,欢迎讨论。 正文: 古话说得好,先问是不是,再问为什么。 对于「国外的 App 很少有开屏广告」这个论断其实未必正确,毕竟商业世界已经发展得很畅通和成熟了,一旦有什么可行的商业模式(比如开屏广告),那必然会被快速地借(chao)鉴(xi)。那为什...

HTML 5 音频(audio)

 audio 元素支持三种音频格式 IE 9 Firefox 3.5 Opera 10.5 Chrome 3.0 Safari 3.0 Ogg Vorbis   √ √ √   MP3 √     √ √ Wav   √ √   √  1、设置一个ogg格式的文件 <audio src="http://t.zoukankan.co...

pd.read_html 获取网页上的表格数据

一、pd.read_html 参数 函数参数 pandas.read_html(io, match='.+', flavor=None, header=None, index_col=None, skiprows=None, attrs=None, parse_dates=False, thousands=',', encoding=None, decim...