title: Dropbox Sync API startLink() method not working
body: <p>I'm developing an Android app that uses the Dropbox Sync API to upload files. I have already created the app on Dropbox, gotten the APP_KEY and the APP_SECRET. I have included all the necessary libraries, set the proper keys in my activity code and the Manifest. My app is similar to the HelloDropbox sample provided in the documentation, but when I click on the "Link to Dropbox" button which is supposed to display a place to enter my dropbox credentials, nothing happens. Here's the source code:</p>
  
  <pre><code>package com.diamondtrust66.helix.player;
  import java.io.File;
  import java.io.IOException;
  import java.util.List;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.dropbox.client2.DropboxAPI;
  import com.dropbox.sync.android.DbxAccountManager;
  import com.dropbox.sync.android.DbxFile;
  import com.dropbox.sync.android.DbxFileInfo;
  import com.dropbox.sync.android.DbxFileSystem;
  import com.dropbox.sync.android.DbxPath;
  
  public class HelixPlayer extends Activity {
  
  private static final String appKey = "1234-my-key";
  private static final String appSecret = "1234-my-secret";
  
  private static final int REQUEST_LINK_TO_DBX = 0;
  
  private TextView mTestOutput;
  private Button mLinkButton;
  private DbxAccountManager mDbxAcctMgr;
  private DropboxAPI&lt;?&gt; mDBApi;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_helix_player);
      mTestOutput = (TextView) findViewById(R.id.test_output);
      mLinkButton = (Button) findViewById(R.id.link_button);
      mLinkButton.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              onClickLinkToDropbox();
          }
      });
  
      mDbxAcctMgr = DbxAccountManager.getInstance(getApplicationContext(), appKey, appSecret);
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      if (mDbxAcctMgr.hasLinkedAccount()) {
          showLinkedView();
          doDropboxTest();
      } else {
          showUnlinkedView();
      }
  }
  
  private void showLinkedView() {
      mLinkButton.setVisibility(View.GONE);
      mTestOutput.setVisibility(View.VISIBLE);
  }
  
  private void showUnlinkedView() {
      mLinkButton.setVisibility(View.VISIBLE);
      mTestOutput.setVisibility(View.GONE);
  }
  
  private void onClickLinkToDropbox() {
      mDbxAcctMgr.startLink((Activity)this, REQUEST_LINK_TO_DBX);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == REQUEST_LINK_TO_DBX) {
          if (resultCode == Activity.RESULT_OK) {
              doDropboxTest();
          } else {
              Toast.makeText(getApplicationContext(), "FAILURE", Toast.LENGTH_LONG).show();
              mTestOutput.setText("Link to Dropbox failed or was cancelled.");
          }
      } else {
          super.onActivityResult(requestCode, resultCode, data);
      }
  }
  
  private void doDropboxTest() {
      try {
          final String TEST_DATA = "Hello Dropbox";
          final String TEST_FILE_NAME = "be like that.mp3";
          DbxPath testPath = new DbxPath(DbxPath.ROOT, TEST_FILE_NAME);
  
          // Create DbxFileSystem for synchronized file access.
          DbxFileSystem dbxFs = DbxFileSystem.forAccount(mDbxAcctMgr.getLinkedAccount());
  
  
  
  
  
          // Print the contents of the root folder.  This will block until we can
          // sync metadata the first time.
          List&lt;DbxFileInfo&gt; infos = dbxFs.listFolder(DbxPath.ROOT);
          mTestOutput.setText("\nContents of app folder:\n");
          for (DbxFileInfo info : infos) {
              mTestOutput.append("    " + info.path + ", " + info.modifiedTime + '\n');
          }
  
          // Create a test file only if it doesn't already exist.
          if (!dbxFs.exists(testPath)) {
              DbxFile testFile = dbxFs.create(testPath);
              try {
  
                  File myFile = new File("/mnt/sdcard/alarms/be like that.mp3");
                  //testFile.writeString(TEST_DATA);
                  testFile.writeFromExistingFile(myFile, false);
              } finally {
                  testFile.close();
              }
              mTestOutput.append("\nCreated new file '" + testPath + "'.\n");
          }
  
          // Read and print the contents of test file.  Since we're not making
          // any attempt to wait for the latest version, this may print an
          // older cached version.  Use getSyncStatus() and/or a listener to
          // check for a new version.
          /*if (dbxFs.isFile(testPath)) {
              String resultData;
              DbxFile testFile = dbxFs.open(testPath);
              try {
                  resultData = testFile.readString();
              } finally {
                  testFile.close();
              }
              mTestOutput.append("\nRead file '" + testPath + "' and got data:\n    " + resultData);
          } else if (dbxFs.isFolder(testPath)) {
              mTestOutput.append("'" + testPath.toString() + "' is a folder.\n");
          }*/
      } catch (IOException e) {
          mTestOutput.setText("Dropbox test failed: " + e);
      }
  }
  </code></pre>
  
  <p>}</p>