"Uses or overrides a deprecated API" in android compiling.
16lz
2022-03-08
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 stubActivityManager 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 ()
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer