コード例 #1
0
ファイル: MainActivity.java プロジェクト: txl0591/InputApp
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   // TODO Auto-generated method stub
   int TextID[] = {R.string.Main_Input, R.string.Main_Seach, R.string.Main_Setting};
   switch (TextID[position]) {
     case R.string.Main_Input:
       mViewCtrl.AddShow(ID_INPUTWRITE);
       break;
     case R.string.Main_Seach:
       mViewCtrl.AddShow(ID_INPUTBROWER);
       break;
     case R.string.Main_Setting:
       break;
   }
 }
コード例 #2
0
ファイル: MainActivity.java プロジェクト: txl0591/InputApp
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    mCDKeyDBHelper = new CDKeyDBHelper(this);

    StartRecvMsg();
    mViewCtrl =
        new ViewCtrl(this, ACTION) {

          @Override
          public void OnExitPage() {
            // TODO Auto-generated method stub
          }

          @Override
          public void OnUpdatePage(int param) {
            // TODO Auto-generated method stub
            if (mViewCtrl.getActiveId() == ID_INPUTWRITE) {
              if (-1 == param) {
                mIntputWrite.setPageType(null);
              } else {
                String str = String.valueOf(param);
                if (str.length() < 6) {
                  int len = 6 - str.length();
                  String real = "";
                  for (int i = 0; i < len; i++) {
                    real = real + "0";
                  }
                  real = real + str;
                  mIntputWrite.setPageType(real);
                } else {
                  mIntputWrite.setPageType(str);
                }
              }
            }
          }
        };

    mViewCtrl.ViewStartBroadcast();
    mRelativeLayout = (RelativeLayout) findViewById(R.id.RFIDWindow);
    DataInfoConvert mDataInfoConvert = new DataInfoConvert(this);
    mDataInfoConvert.Convert();
    mDataInfoDBHelper = new DataInfoDBHelper(this);
    mIntputWrite = new IntputWrite(this, ACTION, ID_INPUTWRITE, mDataInfoDBHelper);
    mInputBrower = new InputBrower(this, ACTION, ID_INPUTBROWER, mDataInfoDBHelper);

    mRelativeLayout.addView(mInputBrower);
    mRelativeLayout.addView(mIntputWrite);
    mViewCtrl.ViewRegister((View) mInputBrower, mViewCtrl.LEVEL_1);
    mViewCtrl.ViewRegister((View) mIntputWrite, mViewCtrl.LEVEL_2);

    mMainClient = new MainClient(this);
    mIntputWrite.setBaseClient(mMainClient);
    mInputBrower.setBaseClient(mMainClient);

    mAESUtils = new AESUtils();
    DeviceInfo mDeviceMD5 = new DeviceInfo(this);
    String MD5 = mDeviceMD5.getCombinedCRC(mAESUtils);
    String SystemReg = getSystemReg();
    // DelectApk();
    MailOper mMailOper = new MailOper();
    mMailOper.SendRegMail(this);

    //		if(SystemReg.equals(MD5)){
    //			mViewCtrl.AddShow(ID_INPUTBROWER);
    //		}else{
    //			ShowLogInDialog();
    //		}
    mViewCtrl.AddShow(ID_INPUTBROWER);
  }