当前位置: 代码迷 >> Android >> "Uses or overrides a deprecated API" in android compiling
  详细解决方案

"Uses or overrides a deprecated API" in android compiling

热度:118   发布时间:2016-05-01 13:17:49.0
"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()

  相关解决方案