首页 > 代码库 > 【Exception】 java.lang.NoSuchMethodError: android.app.AlertDialog$Builder.setOnDismissListener

【Exception】 java.lang.NoSuchMethodError: android.app.AlertDialog$Builder.setOnDismissListener




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


AlertDialog.Builder builder;try{
    builder =newAlertDialog.Builder(getActivity(), R.style.Theme.Sherlock.Dialog);}catch(NoSuchMethodError e){Log.e(TAG,"Older SDK, using old Builder");
    builder =newAlertDialog.Builder(getActivity());}