Created
August 8, 2011 22:57
-
-
Save jasonpolites/1132965 to your computer and use it in GitHub Desktop.
Socialize SDK Android - Comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.socialize.Socialize; | |
import com.socialize.entity.Comment; | |
import com.socialize.error.SocializeException; | |
import com.socialize.listener.comment.CommentAddListener; | |
if(Socialize.getSocialize().isAuthenticated()) { | |
// Add a comment to an entity | |
Socialize.getSocialize().addComment("http://someurl.com", "My comment text", new CommentAddListener() { | |
public void onError(SocializeException error) { | |
// Handle error | |
} | |
public void onCreate(Comment comment) { | |
// Handle success | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.socialize.Socialize; | |
import com.socialize.entity.Comment; | |
import com.socialize.error.SocializeException; | |
import com.socialize.listener.comment.CommentGetListener; | |
if(Socialize.getSocialize().isAuthenticated()) { | |
// Get a single comment based on its numeric ID | |
Socialize.getSocialize().getCommentById(1234, new CommentGetListener() { | |
public void onError(SocializeException error) { | |
// Handle error | |
} | |
public void onGet(Comment entity) { | |
// Handle success | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.socialize.Socialize; | |
import com.socialize.entity.Comment; | |
import com.socialize.entity.ListResult; | |
import com.socialize.error.SocializeException; | |
import com.socialize.listener.comment.CommentListListener; | |
if(Socialize.getSocialize().isAuthenticated()) { | |
// List comments for an entity with pagination (start and end index) | |
Socialize.getSocialize().listCommentsByEntity("http://someurl.com", 0, 100, new CommentListListener() { | |
public void onError(SocializeException error) { | |
// Handle error | |
} | |
public void onList(ListResult<Comment> result) { | |
// Handle success | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.socialize.Socialize; | |
import com.socialize.entity.Comment; | |
import com.socialize.entity.ListResult; | |
import com.socialize.error.SocializeException; | |
import com.socialize.listener.comment.CommentListListener; | |
if(Socialize.getSocialize().isAuthenticated()) { | |
// List comments for an entity without pagination (maximum 100 will be returned) | |
Socialize.getSocialize().listCommentsByEntity("http://someurl.com", new CommentListListener() { | |
public void onError(SocializeException error) { | |
// Handle error | |
} | |
public void onList(ListResult<Comment> result) { | |
// Handle success | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment