/** @see android.app.Activity#onCreate(android.os.Bundle) */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    if (Log.DEBUG) {
      Log.v("GoogleContactsActivity: onCreate()  start");
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gcontactlist);
    mSyncCounter = (TextView) findViewById(R.id.sync_google_counter);

    Button syncButton = (Button) findViewById(R.id.start_sync_button);
    syncButton.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View v) {
            sync();
          }
        });

    mDb = new DbAdapter(this);
    mDb.open(false);

    transport.setVersionHeader(GoogleContacts.VERSION);
    AtomParser atomParser = new AtomParser();
    atomParser.namespaceDictionary = GoogleContactsAtom.NAMESPACE_DICTIONARY;
    transport.addParser(atomParser);
    transport.applicationName = APP_NAME;
    HttpTransport.setLowLevelHttpTransport(ApacheHttpTransport.INSTANCE);
    Intent intent = getIntent();
    if (Intent.ACTION_SEND.equals(intent.getAction())) {
      if (Log.DEBUG) {
        Log.v("Intent.ACTION_SEND.equals( intent.getAction() )");
      }
      sendData = new SendData(intent, getContentResolver());
    } else if (Intent.ACTION_MAIN.equals(intent.getAction())) {
      if (Log.DEBUG) {
        Log.v("Intent.ACTION_MAIN.equals( intent.getAction() )");
      }
      sendData = null;
    }
    gotAccount(false);
    if (Log.DEBUG) {
      Log.v("GoogleContactsActivity: onCreate() stop");
    }
  }