picview/src/com/google/android/apps/picview/activities/AddEditAccountFragment.java
private void addListeners(View view) {
    final Spinner accountType = (Spinner) view.findViewById(R.id.account_type);
    final EditText accountId = (EditText) view.findViewById(R.id.account_id);
    final EditText accountName = (EditText) view
        .findViewById(R.id.account_name);

    Button okButton = (Button) view.findViewById(R.id.ok);
    okButton.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        int type = accountType.getSelectedItemPosition();
        String id = accountId.getText().toString();
        String name = accountName.getText().toString();
        callback.onAddAccount(type, id, name);
        dismiss();
      }
    });

    Button cancelButton = (Button) view.findViewById(R.id.cancel);
    cancelButton.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        AddEditAccountFragment.this.dismiss();
      }
    });
  }
/**
   * Adds the UI listeners to the view.
   */
Adds the UI listeners to the view.
Adds the UI listeners to the view .
private void addListeners(View view) {
    final Spinner accountType = (Spinner) view.findViewById(R.id.account_type);
    final EditText accountId = (EditText) view.findViewById(R.id.account_id);
    final EditText accountName = (EditText) view
        .findViewById(R.id.account_name);
    Button okButton = (Button) view.findViewById(R.id.ok);
    okButton.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        int type = accountType.getSelectedItemPosition();
        String id = accountId.getText().toString();
        String name = accountName.getText().toString();
        callback.onAddAccount(type, id, name);
        dismiss();
      }
    });
    Button cancelButton = (Button) view.findViewById(R.id.cancel);
    cancelButton.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) {
        AddEditAccountFragment.this.dismiss();
      }
    });
  }
private void addListeners ( View view ) { final Spinner accountType = ( Spinner ) view . findViewById ( R . id . account_type ) ; final EditText accountId = ( EditText ) view . findViewById ( R . id . account_id ) ; final EditText accountName = ( EditText ) view . findViewById ( R . id . account_name ) ; Button okButton = ( Button ) view . findViewById ( R . id . ok ) ; okButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { int type = accountType . getSelectedItemPosition ( ) ; String id = accountId . getText ( ) . toString ( ) ; String name = accountName . getText ( ) . toString ( ) ; callback . onAddAccount ( type , id , name ) ; dismiss ( ) ; } } ) ; Button cancelButton = ( Button ) view . findViewById ( R . id . cancel ) ; cancelButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { AddEditAccountFragment . this . dismiss ( ) ; } } ) ; }
Adds the UI listeners to the view.
Adds the UI listeners to the view .