我正在尝试设置一个消息应用程序:
try { 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); } else { Toast.makeText(Remotelock.this, "message are not equal!", Toast.LENGTH_LONG).show(); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }
答案 0 :(得分:0)
try {
if (PreferenceConnector.readString(context,"MSG","tempmsg2").equals(messages[0].getMessageBody())) {
Intent i = new Intent(mContext,SecureMobiActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(i);
} else {
Toast.makeText(Remotelock.this, "message are not equal!", Toast.LENGTH_LONG).show();
}
catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}