Simple. You use boolean values. By default you'll have a split ActionBar if the screen width is smaller than 400dp. So in your values folder you can put:
/values/bools.xml:
<resources>
<bool name="split_action_bar">true</bool>
</resources>
and in your values-sw400dp you put the following.
/values-sw400dp/bools.xml:
<resources>
<bool name="split_action_bar">false</bool>
</resources>
Now you can set your icon based on that value:
boolean isActionBarSplitted = getResources().getBoolean(R.bool.split_action_bar);
if(isActionBarSplitted){
// set light icon
}
else{
// set dark icon
}
Edit:
Actually forget what I wrote, you don't need to create your own boolean value to check it. There is already one declared(which is the one the ActionBar uses to determine if it is a handset device or a tablet).
If you're targeting Android HC+, then you can access the default ActionBars value:
android.R.bool.split_action_bar_is_narrow
, if you are using ActionBarSherlock:
R.bool.abs_split_action_bar_is_narrow
.
Found here for the default ActionBar, here your ABS.