我正在使用此代码。完成Manifest.xml权限。
private static String app_key = "88888888888";
private static String app_secret = "*******************";
private static final int REQUEST_LINK_TO_DBX = 0;
private TextView mTestOutput;
private Button mLinkButton;
private DbxAccountManager mDbxAcctMgr;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mLinkButton = (Button) findViewById(R.id.button1);
mDbxAcctMgr = DbxAccountManager.getInstance(getApplicationContext(), app_key, app_secret);
mLinkButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
callmethod();
}
});
}
private void callmethod() {
mDbxAcctMgr.startLink(MainActivity.this,REQUEST_LINK_TO_DBX );
}