`

"Uses or overrides a deprecated API" in android compiling.

阅读更多

Sometimes we write android apps with eclipse and generate apks normally, but put the apks' package in base for entire build, we get the warning/error "uses or overrides a deprecated API", then quit the building.

 

A deprecated API is an API or part of API that is not officially supported anymore, the compiler will check for it and throw the warning/error then.

 

Here we should manage our APIs.

i.e.

 

 

btn.setOnClickListener(new View.OnClickListener(){

			public void onClick(View v) {
				// TODO Auto-generated method stub
				ActivityManager am = (ActivityManager)cnx.getSystemService(Context.ACTIVITY_SERVICE);
				ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
				String des = (String)am.getRunningTasks(1).get(0).description;
				bmp = am.getRunningTasks(1).get(0).thumbnail;
				
				Log.i("SnapshotDemo","bmp = "+bmp+"/ncn = "+cn+"/ndes = "+des);
			}
        	
        });
 

Android recommend to use new View.OnClickListener ()

分享到:
评论

相关推荐

    FragmentView

    将fragment和listview结合使用 @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment1, null);...

    man-pages-overrides-8.5.0.0-1.el8.noarch.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

    man-pages-overrides-7.6.2-1.el7.x86_64.rpm

    离线安装包,亲测可用

    man-pages-overrides-7.9.0-1.el7.x86_64.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

    man-pages-overrides-8.3.0.2-2.el8.noarch.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

    man-pages-overrides-8.5.0.1-1.el8.noarch(1).rpm

    离线安装包,亲测可用

    servlet2.4doc

    A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the ...

    java网络对战的国际象棋源码

    Note: * uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: ...

    android.jar 源码

    昨天花了一个晚上用git 从http://android.git.kernel.org/platform/frameworks/base.git 上搞下来的,给有需要的朋友,使用方法:在android.jar 同级目录下新建sources文件夹,将解压的内容放入其中,在eclipse中...

    Android build.prop生成过程y源码分析

    ### Android build.prop生成过程源码分析 #### 一、概览 `build.prop`是Android系统中的一个关键配置文件,它记录了系统构建时的重要属性信息,如屏幕密度(LCD density)、默认语言设置、编译时间等。这些信息对于...

    antd配置config-overrides.js文件的操作

    下载antd 包 npm install antd 下载依赖包(定义组件按...根目录定义加载按需打包的js配置模块: config-overrides.js const {override,fixBabelImports,addLessLoader} =require('customize-cra'); module.exports =

    log4j配置范例

    log4j配置范例,完全手写会遇到困难吗,这是个例子供大家参考

    Python库 | gc-overrides-0.1.0.tar.gz

    "gc-overrides-0.1.0.tar.gz" 是一个针对Python的库,名为“gc-overrides”,其版本号为0.1.0。这个库很可能涉及到Python的垃圾收集(Garbage Collection)机制的增强或定制。 垃圾收集是Python中的一个重要概念,...

    Android 4.0 Compatibility Definition

    In summary, the Android 4.0 Compatibility Definition Document covers a wide range of areas, from software and user interface compatibility to hardware and performance compatibility, ensuring that ...

    Android 跨进程模拟按键(KeyEvent )实例详解

    在`AndroidManifest.xml`中添加`<uses-permission android:name="android.permission.INJECT_EVENTS" />`后,仍然无法解决问题,这是由于Android的安全机制,系统会检查调用进程的PID和UID,如果不是系统级别,注入...

    SPRING API 2.0.CHM

    MethodOverrides MethodParameter MethodReplacer MimeMailMessage MimeMessageHelper MimeMessagePreparator MockActionRequest MockActionResponse MockExpressionEvaluator MockFilterConfig Mock...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Note: If you use a symbol Foo in your source file, you should bring in a definition for Foo yourself, either via an #include or via a forward declaration. Do not depend on the symbol being brought in ...

    微软内部资料-SQL性能优化5

    Each index row in node pages contains an index key (or set of keys for a composite index) and a pointer to a page at the next level for which the first key value is the same as the key value in the ...

Global site tag (gtag.js) - Google Analytics