永远不会调用onRegistered方法,在logcat中我看到最后一行是获取唤醒锁.
- 09-26 14:03:23.285:D/GCMRegistrar(15820):重置退避
- 09-26 14:03:23.285:V/GCMRegistrar(15820):注册app*a发件人735175912799
- 09-26 14:03:23.895:V/GCMBroadcastReceiver(15820):onReceive: - com.google.android.c2dm.intent.REGISTRATION 09-26 14:03:23.895:V/GCMRegistrar(15820):设置名称重试接收器类到*.notifications.MyGCMBroadcastReceiver
- 09-26 14:03:23.895:V/GCMBroadcastReceiver(15820):GCM IntentService类: - *.notifications.GCMIntentService
- 09-26 14:03:23.903:V/GCMBaseIntentService(15820):获取唤醒锁
我有自己的Broadcastreceiver:
import com.google.android.gcm.GCMBroadcastReceiver;
public class MyGCMBroadcastReceiver extends GCMBroadcastReceiver {
@Override
protected String getGCMIntentServiceClassName (Context context) {
return GCMIntentService.class.getCanonicalName();
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试初始化Cipher对象以进行加密和解密.
String cipher = privateKey.getAlgorithm() + "/ECB/PKCS1Padding";
mCipher = Cipher.getInstance(cipher, "AndroidKeyStore");
Run Code Online (Sandbox Code Playgroud)
我一直在android上得到以下异常:
System.err: java.security.NoSuchAlgorithmException: Provider AndroidKeyStore does not provide RSA/ECB/PKCS1Padding
03-20 00:28:38.270 19817 21488 W System.err: at javax.crypto.Cipher.getCipher(Cipher.java:357)
03-20 00:28:38.270 19817 21488 W System.err: at javax.crypto.Cipher.getInstance(Cipher.java:325)
03-20 00:28:38.271 19817 21488 W System.err: at javax.crypto.Cipher.getInstance(Cipher.java:297)
Run Code Online (Sandbox Code Playgroud) 我有一个jobcheduler触发了Jobservice的onStartjob.在onStartJob中,我启动了一个intentservice来完成这项工作.工作完成后,我希望intentservice对jobservice进行回调,以便可以调用onjobfinished.如何回复JobService?