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

你可能感兴趣的:(eclipse,android)