我试图在android中实现gcm客户端并在logcat上显示注册ID。但是logcat会连续显示除我打算显示的内容之外的其他内容。
package in.myreceiver.gcm;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class SeriousBroadcastReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
try{
String action=intent.getAction();
if(action.equals("com.google.android.c2dm.intent.REGISTRATION"))
{
String registrationId=intent.getStringExtra("registration_Id");
Log.i("uo",registrationId);
String error=intent.getStringExtra("error");
String unregistered=intent.getStringExtra("unregistered");
}
else if(action.equals("com.google.android.c2dm.intent.RECEIVE"))
{
String data1=intent.getStringExtra("data1");
String data2=intent.getStringExtra("data2");
}
}
finally{}
}
}
答案 0 :(得分:0)
搜索您的标签“uo”... LogCat显示来自设备的所有日志(操作系统等)