在我的应用程序中,我为gcm ccs(xmpp)运行这些代码,代码显示以下错误执行时发生错误doinbackground.excute()
这是代码:
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
} …
Run Code Online (Sandbox Code Playgroud)