/**
 * Copyright (c) 2013 DuoKu Inc.
 */
package com.caimai.platform.demo.activity;

import android.app.Activity;
import android.app.ProgressDialog;

import com.caimai.platform.demo.utils.Constant;
import com.duoku.game.DKGameSDK;

public class BaseActivity extends Activity {
	private ProgressDialog progressDialog;

	protected void showLoading() {
		progressDialog = new ProgressDialog(this);
		progressDialog.setMessage("正在加载...");
		progressDialog.setIndeterminate(true);
		progressDialog.setCancelable(false);
		progressDialog.show();
	}

	protected void showLoading(String tips) {
		progressDialog = new ProgressDialog(this);
		progressDialog.setMessage(tips);
		progressDialog.setIndeterminate(true);
		progressDialog.setCancelable(false);
		progressDialog.show();
	}

	protected void hideLoading() {
		if (progressDialog != null) {
			progressDialog.cancel();
			progressDialog = null;
		}
	}

	@Override
	protected void onStop() {
		super.onStop();
	}

	@Override
	protected void onResume() {
		super.onResume();
		DKGameSDK.onResume(this, Constant.appKey_DkDemo);
	}

	@Override
	protected void onPause() {
		super.onPause();
		DKGameSDK.onPause(this, Constant.appKey_DkDemo);
	}
}
