• BaseActivity合集


    1.出自“高仿京东商城”:

    package com.itau.jingdong.ui.base;
    
    import com.itau.jingdong.AppManager;
    import com.itau.jingdong.config.Constants;
    import com.itau.jingdong.image.ImageLoaderConfig;
    import com.nostra13.universalimageloader.core.ImageLoader;
    
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    
    /**
     * @author Tau.Chen 陈涛
     * 
     * @email tauchen1990@gmail.com,1076559197@qq.com
     * 
     * @date 2013年9月12日
     * 
     * @version V_1.0.0
     * 
     * @description
     * 
     */
    public abstract class BaseActivity extends Activity {
    
        public static final String TAG = BaseActivity.class.getSimpleName();
    
        protected Handler mHandler = null;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            AppManager.getInstance().addActivity(this);
            if (!ImageLoader.getInstance().isInited()) {
                ImageLoaderConfig.initImageLoader(this, Constants.BASE_IMAGE_CACHE);
            }
        }
    
        @Override
        protected void onDestroy() {
            // TODO Auto-generated method stub
            super.onDestroy();
        }
    
        @Override
        protected void onPause() {
            // TODO Auto-generated method stub
            super.onPause();
        }
    
        @Override
        protected void onRestart() {
            // TODO Auto-generated method stub
            super.onRestart();
        }
    
        @Override
        protected void onResume() {
            // TODO Auto-generated method stub
            super.onResume();
        }
    
        @Override
        protected void onStart() {
            // TODO Auto-generated method stub
            super.onStart();
        }
    
        @Override
        protected void onStop() {
            // TODO Auto-generated method stub
            super.onStop();
        }
    
        /**
         * 绑定控件id
         */
        protected abstract void findViewById();
    
        /**
         * 初始化控件
         */
        protected abstract void initView();
    
        /**
         * 通过类名启动Activity
         * 
         * @param pClass
         */
        protected void openActivity(Class<?> pClass) {
            openActivity(pClass, null);
        }
    
        /**
         * 通过类名启动Activity,并且含有Bundle数据
         * 
         * @param pClass
         * @param pBundle
         */
        protected void openActivity(Class<?> pClass, Bundle pBundle) {
            Intent intent = new Intent(this, pClass);
            if (pBundle != null) {
                intent.putExtras(pBundle);
            }
            startActivity(intent);
        }
    
        /**
         * 通过Action启动Activity
         * 
         * @param pAction
         */
        protected void openActivity(String pAction) {
            openActivity(pAction, null);
        }
    
        /**
         * 通过Action启动Activity,并且含有Bundle数据
         * 
         * @param pAction
         * @param pBundle
         */
        protected void openActivity(String pAction, Bundle pBundle) {
            Intent intent = new Intent(pAction);
            if (pBundle != null) {
                intent.putExtras(pBundle);
            }
            startActivity(intent);
        }
    
    }
  • 相关阅读:
    Python--json处理
    Python--加密模块
    Python--函数即变量
    bzoj 2276: [Poi2011]Temperature
    1616: [Usaco2008 Mar]Cow Travelling游荡的奶牛
    2017 9 15 noip模拟赛
    bzoj 1612: [Usaco2008 Jan]Cow Contest奶牛的比赛
    2017 9 11 noip模拟赛T2
    URAL 1613. For Fans of Statistics (2017 9 6 noip模拟赛T3)
    codeforces 105 B. Dark Assembly(birbe贿赂 noip模拟赛)
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4201608.html
Copyright © 2020-2023  润新知