Ejemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
    setContentView(R.layout.activity_main);
    this.FindAllViewsById();
    AppGlobals.setContext(getBaseContext());
    AppGlobals.MainActivity = this;
    loginButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // Alt+240 : ≡
            if (userNameEditText.getText().length() == 0
                || passwordEditText.getText().length() == 0) {
              Toast.makeText(
                      getBaseContext(),
                      "Please enter correct username or password",
                      Toast.LENGTH_LONG)
                  .show();
              return;
            }

            String query =
                userNameEditText.getText()
                    + "≡"
                    + passwordEditText.getText(); // searchEditText.getText().toString();
            performSearch(query);
          }
        });
    mBtp.setDebugService(true);
    try {
      mBtp.initService(this, mHandler);
    } catch (Exception e) {
      e.printStackTrace();
    }

    IntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED);
    IntentFilter filter2 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
    IntentFilter filter3 = new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED);
    this.registerReceiver(mReceiver, filter1);
    this.registerReceiver(mReceiver, filter2);
    this.registerReceiver(mReceiver, filter3);
    AppGlobals.MacId = MacHelper.GetMacId();
    versionTextView.setText("Version: " + BuildConfig.VERSION_NAME);
  }
Ejemplo n.º 2
0
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   mBtp.onActivityResult(requestCode, resultCode, data, this);
 }
Ejemplo n.º 3
0
 @Override
 public void onResume() {
   mBtp.onActivityResume();
   DebugLog.logTrace("onResume");
   super.onResume();
 }
Ejemplo n.º 4
0
 @Override
 public void onDestroy() {
   mBtp.onActivityDestroy();
   super.onDestroy();
 }
Ejemplo n.º 5
0
 @Override
 public void onPause() {
   mBtp.onActivityPause();
   super.onPause();
 }