Support Topics Documentation Slack YouTube Blog

MessageStatus in Async Call giving casting exception

(Muhammad Kamran Latif Raza) #1

Logcat of error

java.lang.ClassCastException: java.util.HashMap cannot be cast to

at com.<Package-name>.others.Helper$6$1.handleResponse(
at com.backendless.async.message.AsyncMessage$ResponseHandler.handle(
at com.backendless.async.message.AsyncMessage.handleCallback(
at android.os.Handler.dispatchMessage(
at com.backendless.core.AndroidCarrier$1.handleMessage(

Here is code that was working just fine 2 days ago.

 (Object) jsonResponceData
new AsyncCallback<MessageStatus>() {
 public void handleResponse(
 MessageStatus status) {
 public void handleFault(
 BackendlessFault fault) {
 + "\n"
 + fault.getDetail());

(Muhammad Kamran Latif Raza) #2
Tried with 
compile 'com.backendless:backendless:+' 

and this as well
compile 'com.backendless:backendless:' 

also used jar file but still no luck…

(Muhammad Kamran Latif Raza) #3

While you guys are busy with other things, I was looking for an answer to my problem.

I found it very odd that when I included AdMob into my code, it gives me error above mentioned. When I removed it and error is gone as well. Working fine.

Please Do something about it.

(Muhammad Kamran Latif Raza) #4

I used AdMob Code into PushDemo and Same result. That weird exception came from that app too. Check the log

log.txt (1.58kB)

(Muhammad Kamran Latif Raza) #5

Just curious, I changed ads library to StartApp that same problem occurs. Ads work fine in both cases. (admob & startApp).
I even tried to give ads a new Handler runnable as well

Handler handler = new Handler(); 
Runnable runnable = new Runnable() { 
 public void run() { 
 // Get the Main relative layout of the entire activity 
 RelativeLayout mainLayout = (RelativeLayout) findViewById(; 
 // Define StartApp Banner 
 Banner startAppBanner = new Banner(context); 
 RelativeLayout.LayoutParams bannerParameters = 
 new RelativeLayout.LayoutParams( 
 // Add to main Layout 
 mainLayout.addView(startAppBanner, bannerParameters); 

But no luck. I think this is as far as my knowledge goes. I can’t think of something else except waiting for a good answer from support.
Push messages receive correctly, but cannot send them.