zoukankan      html  css  js  c++  java
  • 这个在干吗?

       /**
         * @brief Action列表。
         */
        private List<String> mActionList = new ArrayList<String>();

        /**
         * @brief Action处理线程。
         */
        private CustomThread mActionListThread = new CustomThread() {
            /**
             * @brief  线程执行函数。
             */
            protected void _execute() {
                try {
                    synchronized(mActionList) {
                        //取得Action
                        if (mActionList.size() > 0) {
                            String data = mActionList.get(0);
                            if (data != null) {
                                mActionList.remove(0);
                                if (mAdapter.action(data) != true) {
                                    Log.e(TAG, "_execute(): bad action! (" + data + ")");
                                }
                            }
                            else {
                                Log.e(TAG, "_execute(): data is null!");
                            }
                        }
                    }
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        };
    ---------------------------------------------
       /**
         * @brief     向Action队列发送Action函数。
         * @param[in] action Action数据。
         */
        private void _action(String action) {
            if ((action != null) && (action.length() > 0)) {
                synchronized(mActionList) {
                    //向Action队列中追加Action
                    mActionList.add(action);
                }
            }
            else {
                Log.e(TAG, "_action(): action is null!");
            }
        }
    --------------------------------------
        /**
         * @brief Action广播监听器。
         */
        private BroadcastReceiver mActionReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                Log.d(TAG, "onReceive() start");


                if (intent != null) {
                    try {
                        String action = intent.getStringExtra("Action");
                        _action(action);
                    }
                    catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                else {
                    Log.e(TAG, "onReceive(): intent is null!");
                }
                Log.d(TAG, "onReceive() end");
            }
        };





  • 相关阅读:
    【 一次性密码】TOTP
    动态令牌-(OTP,HOTP,TOTP)-基本原理
    动态口令
    Jmeter参数化 CSV Data Set Config界面说明
    Jmeter测试监控 Summary Report界面
    jmeter命令行参数
    jmeter场景设计
    jmeter事务控制器
    软件测试模型
    业务流程测试
  • 原文地址:https://www.cnblogs.com/riskyer/p/3253706.html
Copyright © 2011-2022 走看看