In my application I run these code for gcm ccs(xmpp) and the code shows following error An error occurred while executing doinbackground.excute()
This is the code:
sendTask = new AsyncTask<String, String, String>() {
protected String doInBackground(String... title) {
Bundle data = new Bundle();
data.putString("ACTION", action);
data.putString("CLIENT_MESSAGE", "Hello GCM CCS XMPP!");
String id = Integer.toString(ccsMsgId.incrementAndGet());
try {
Log.d("RegisterActivity", "messageid: " + id);
gcm.send(SENDER_ID + "@gcm.googleapis.com", id,
data);
Log.d("RegisterActivity", "After gcm.send successful.");
} catch (IOException e) {
Log.d("RegisterActivity", "Exception: " + e);
e.printStackTrace();
}
return "Sent message.";
}
protected void onPostExecute(String result) {
sendTask = null;
// tosat about the success in return
}
};
sendTask.execute(null, null, null);