tumblr / jumblr

Tumblr API v2 Java Client
Apache License 2.0
278 stars 105 forks source link

Can't get info out of userDashboard() #73

Closed CodosaurusRex closed 9 years ago

CodosaurusRex commented 9 years ago

Hi! Thanks for writing Jumblr it's awesome. I'm trying implement an android application that can display my dashboard- trying to get information out of the posts on my dash. However, when I try to do getType(), an empty string is returned. Is that a problem with my code, or Jumblr?

Thanks so much.

    JumblrClient client = new JumblrClient(consumerKey, consumerSecret); 
    client.setToken(oAuthToken, oAuthSecret);
    List<Post> posts = client.userDashboard();
    for (int i = 0; i < posts.size(); i++){
    Post post = (Post) posts.get(i);
    String postStr = post.toString();
    Log.e("Post Type", post.getType());
    Log.e("Author", post.getAuthorId());
ericleong commented 9 years ago

I can't seem to reproduce the issue using your code (with a few syntax corrections). Does this happen with all posts? Are the other fields empty too (like id)?

CodosaurusRex commented 9 years ago

Thanks for getting back to me! It was a mistake on my part- was unaware that I was filtering the LogCat, and missed the correct entries. Cheers!

CodosaurusRex commented 9 years ago

Sorry- one more question about Jumblr. Is there any way we can store com.tumblr.jumblr.types.Resource in an intent?

ericleong commented 9 years ago

Sorry- one more question about Jumblr. Is there any way we can store com.tumblr.jumblr.types.Resource in an intent?

You'll need to write your own Parcelable class, since jumblr is just a Java library that doesn't know about Android.