Android examples for User Interface:View Property
Safely sets elevation of a view by checking to make sure View.setElevation() is supported
import android.os.Build; import android.view.View; public class Main{ /**//from w ww . j av a 2 s .c o m * Safely sets elevation of a view by checking to * make sure View.setElevation() is supported * * @param view to set the elevation for * @param elevation to set the view to */ public static void setElevation(View view, float elevation) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) { view.setElevation(elevation); } } }