Beispiel #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
      if (!resolveIntent(intent)) {
        finish();
        return;
      }

      if (TextUtils.isEmpty(mToAddress)) {
        Log.w(ImApp.LOG_TAG, "<ImUrlActivity>Invalid to address:" + mToAddress);
        finish();
        return;
      }
      mApp = ImApp.getApplication(this);
      mApp.callWhenServiceConnected(
          new Handler(),
          new Runnable() {
            public void run() {
              handleIntent();
            }
          });

    } else {
      finish();
    }
  }
  @Override
  protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    Intent intent = getIntent();
    Uri data = intent.getData();
    if (data == null) {
      Log.e(ImApp.LOG_TAG, "Need account data to sign in");
      // finish();
      return;
    }

    ContentResolver cr = getContentResolver();

    Cursor c =
        cr.query(
            data,
            ACCOUNT_SELECTION,
            null /* selection */,
            null /* selection args */,
            null /* sort order */);
    final long providerId;
    final long accountId;

    try {
      if (!c.moveToFirst()) {
        LogCleaner.warn(ImApp.LOG_TAG, "[SignoutActivity] No data for " + data);
        //   finish();
        return;
      }

      providerId = c.getLong(c.getColumnIndexOrThrow(Imps.Account.PROVIDER));
      accountId = c.getLong(c.getColumnIndexOrThrow(Imps.Account._ID));
    } finally {
      c.close();
    }

    mApp = (ImApp) getApplication();
    mApp.callWhenServiceConnected(
        mHandler,
        new Runnable() {
          public void run() {
            signOut(providerId, accountId);
          }
        });
  }
Beispiel #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mSignInHelper = new SignInHelper(this);
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    mDefaultLocale = prefs.getString(getString(R.string.pref_default_locale), null);
    setContentView(R.layout.welcome_activity);
    Button getStarted = ((Button) findViewById(R.id.btnSplashAbout));

    getStarted.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
            Intent intent = new Intent(getBaseContext(), AboutActivity.class);
            startActivity(intent);
          }
        });

    mDoSignIn = getIntent().getBooleanExtra("doSignIn", true);
  }