You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ParseClassName("Chat")
public class Chat extends ParseObject {
private Boolean togroupbuy;
private ParseObject products;
private ParseUser user;
private String chatid;
private String content;
public Chat() {
}
public Boolean getTogroupbuy() {
return togroupbuy;
}
public void setTogroupbuy(Boolean togroupbuy) {
this.togroupbuy = togroupbuy;
}
..
}
and my subscription program
ParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();
ParseQuery<Chat> parseQuery = new ParseQuery("Chat");
SubscriptionHandling<Chat> subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
subscriptionHandling.handleEvents(new SubscriptionHandling.HandleEventsCallback<Chat>() {
@Override
public void onEvents(ParseQuery<Chat> query, SubscriptionHandling.Event event, Chat object) {
Log.d("test", "live query is live");
}
});
after change the data via Dashboard, then app will get exception like below:
tw.com.readycom.livequery E/ParseLiveQueryClient: Error handling message
java.lang.ClassCastException: com.parse.ParseObject cannot be cast to tw.com.readycom.livequery.Chat
at tw.com.readycom.livequery.MainActivity$2.onEvents(MainActivity.java:69)
at com.parse.Subscription.didReceive(Subscription.java:80)
at com.parse.ParseLiveQueryClientImpl.handleObjectEvent(ParseLiveQueryClientImpl.java:325)
at com.parse.ParseLiveQueryClientImpl.parseMessage(ParseLiveQueryClientImpl.java:255)
at com.parse.ParseLiveQueryClientImpl.access$000(ParseLiveQueryClientImpl.java:24)
at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:203)
at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:201)
at bolts.Task$4.run(Task.java:357)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
The text was updated successfully, but these errors were encountered:
My class define:
and my subscription program
ParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();
after change the data via Dashboard, then app will get exception like below:
tw.com.readycom.livequery E/ParseLiveQueryClient: Error handling message
java.lang.ClassCastException: com.parse.ParseObject cannot be cast to tw.com.readycom.livequery.Chat
at tw.com.readycom.livequery.MainActivity$2.onEvents(MainActivity.java:69)
at com.parse.Subscription.didReceive(Subscription.java:80)
at com.parse.ParseLiveQueryClientImpl.handleObjectEvent(ParseLiveQueryClientImpl.java:325)
at com.parse.ParseLiveQueryClientImpl.parseMessage(ParseLiveQueryClientImpl.java:255)
at com.parse.ParseLiveQueryClientImpl.access$000(ParseLiveQueryClientImpl.java:24)
at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:203)
at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:201)
at bolts.Task$4.run(Task.java:357)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
The text was updated successfully, but these errors were encountered: