2013. 7. 12. 16:01

It's deprecated but it still works so you could just use it. But if you want to be completly correct, just for the completeness of it... You'd do something like following:

int sdk = android.os.Build.VERSION.SDK_INT;
if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) {
    setBackgroundDrawable();
} else {
    setBackground();
}


if (Build.VERSION.SDK_INT > 10)
    builder =  new AlertDialog.Builder(getActivity(), R.style.Theme.Sherlock.Dialog);
else
    builder =  new AlertDialog.Builder(getActivity());


'Android > 개발팁' 카테고리의 다른 글

Gradient buttons  (0) 2013.08.22
Thread Hanlder 간단하게 쓰기  (0) 2013.07.24
[Android] keyboard 감지  (0) 2013.07.08
How to replace R.drawable.“someString”  (0) 2013.06.25
What adapter shall I use to use HashMap in a ListView  (0) 2013.06.25
Posted by hoonihoon