private void HttpReuqestFailure() { if (getActivity() != null) { circleProgress.stopAnim(); circleProgress.reset(); progress.setVisibility(View.GONE); rlCourseInformation.setVisibility(View.VISIBLE); Dialog dialog = new AlertDialog.Builder(getActivity()) .setTitle("请求失败") .setMessage("请求失败,点击确定重新获取") .setNeutralButton( "确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { RequestCourses(); } }) .setPositiveButton( "返回", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); getActivity().finish(); } }) .create(); dialog.setCanceledOnTouchOutside(false); dialog.show(); } }
private void SetCircleProgressGone() { if (getActivity() != null) { if (mHttpResponseCourses != null && mHttpResponseUniversities != null) { circleProgress.stopAnim(); circleProgress.reset(); progress.setVisibility(View.GONE); rlCourseInformation.setVisibility(View.VISIBLE); ((CourseActivity) getActivity()).setChangePageFlag(true); } } }
private void SetCircleProgressVisible() { if (getActivity() != null) { progress.setVisibility(View.VISIBLE); rlCourseInformation.setVisibility(View.GONE); circleProgress.startAnim(); } }