我正在尝试设置一个消息应用程序,以便:
- 首先我们在 PreferenceConnector 上设置一条消息,然后我们收到消息
- BroadcastReceiver 检查消息内容是否相等
- 我想获得一个 PendingIntent。
尝试 { if (PreferenceConnector.readString(context,"MSG","tempmsg2").equals(messages[0].getMessageBody())) { Intent i=new Intent(context, SecureMobiActivity.class); PendingIntent pi=PendingIntent.getBroadcast(context, 0, i, 0); } 别的 { Toast.makeText(Remotelock.this, "消息不相等!", Toast.LENGTH_LONG).show(); } 捕获(异常 e){ // TODO: 处理异常 e.printStackTrace(); }