首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

"Uses or overrides a deprecated API" in android compiling

2012-11-07 
Uses or overrides a deprecated API in android compiling.Sometimes we write android apps with ecli

"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 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()

热点排行