After setting the elevation of the action bar programmatically, the code becomes highlighted in yellow and the warning below gets thrown. What can be done to remove this warning?
getSupportActionBar().setElevation(0);
Warning
Method invocation 'getSupportActionBar().setElevation(0);' may produce 'java.lang.NullPointerException'