Search Results

Search found 4 results on 1 pages for 'boardy'.

Page 1/1 | 1 

  • Uploading file to DropBox causing UnlinkedException

    - by Boardy
    I am currently working on android project and trying to enable DropBox functionality. I've selected the access type to App Only, and I can successfully authenticate and it creates an Apps directory and inside that creates a directory with the name of my app. When I then try to put a file in the DropBox directory it goes into the DropBoxException catch and in the logcat prints com.dropbox.client2.exception.DropboxUnlinkedException. I've done a google and from what I've seen this happens if the apps directory has been deleted and so authentication is required to be re-done, but this isn't the case, I have deleted it and I am putting the file straight after doing the authentication. Below is the code that retrieves the keys and stores the file on dropbox. AccessTokenPair tokens = getTokens(); UploadFile uploadFile = new UploadFile(context, common, this, mDBApi); uploadFile.execute(mDBApi); Below is the code for the getTokens method (don't think this would help but you never know) private AccessTokenPair getTokens() { AccessTokenPair tokens; SharedPreferences prefs = context.getSharedPreferences("prefs", 0); String key = prefs.getString("dropbox_key", ""); String secret = prefs.getString("dropbox_secret", ""); tokens = new AccessTokenPair(key, secret); return tokens; } Below is the class that extends the AsyncTask to perform the upload class UploadFile extends AsyncTask<DropboxAPI<AndroidAuthSession>, Void, bool> { Context context; Common common; Synchronisation sync; DropboxAPI<AndroidAuthSession> mDBApi; public UploadFile(Context context, Common common, Synchronisation sync, DropboxAPI<AndroidAuthSession> mDBApi) { this.context = context; this.common = common; this.sync = sync; this.mDBApi = mDBApi; } @Override protected bool doInBackground(DropboxAPI<AndroidAuthSession>... params) { try { File file = new File(Environment.getExternalStorageDirectory() + "/BoardiesPasswordManager/dropbox_sync.xml"); FileInputStream inputStream = new FileInputStream(file); Entry newEntry = mDBApi.putFile("android_sync.xml", inputStream, file.length(), null, null); common.showToastMessage("Successfully uploade Rev: " + newEntry.rev, Toast.LENGTH_LONG); } catch (IOException ex) { Log.e("DropBoxError", ex.toString()); } catch (DropboxException e) { Log.e("DropBoxError", e.toString()); e.printStackTrace(); } return null; } I have no idea why it would display the UnlinkedException so any help would be greatly appreciated.

    Read the article

  • Updating GUI Component from a different class C# WPF

    - by Boardy
    Hi all, I am trying to update a GUI component (DataGrid) in one class from a different class. I am using C# and WPF Forms. When I used the standard WF forms I could pass a reference to the GUI component as a parameter to the function that needed to do the work with the DataGrid. However, I do not know how I can do this in WPF. I have Class1 which has the GUI component and I need Class3 to run the function inside Class2 which will automatically update the GUI display of the Datagrid found in Class1. Any help with this would be much appreciated.

    Read the article

  • Returning an array from an activity

    - by Boardy
    I am currently working on an android project and I want to be able to startActivityForResult so that I can return an array of. The array is an ArrayList<Spanned> lets say its called myArray. From what I've read I can't return an array directly from the activty using the set result so I was thinking that once the array has added all the data to the array, I can then call the toString function on it, i.e. myArray.toString(). If I do this, I have no idea how I can then convert this back into the original ArrayList<Spanned>. Thanks for any help you can provide.

    Read the article

  • Adding my own items to Long Click on Text Box menu on android

    - by Boardy
    Hi all, I am currently developing an application for android. I'm not sure if this is possible but here it goes. When the user clicks and holds on a text box whether it is a website or a piece of software a menu is displayed which shows paste and input method. What I want to be able to do is add my own items to this menu and when the user clicks on my item it will load my app, they can select an item from a list view. It will then copy the contents and automatically paste it into the text field the user selected. Thanks for your help in this matter

    Read the article

1