1
我想在MainActivity
和BroacastReceviever
之间进行通信。getIntent()在第一个主要活动中返回什么?
当一条消息到来时,在MainActivity
中,应该有图标上的动画。所以当我收到消息时,我就开始主要活动。但我无法处理动画。
还有就是我下面主要业务代码:
Intent intent = getIntent();
Toast.makeText(this, "wow", Toast.LENGTH_SHORT).show();
if(intent.getStringExtra("receive").equals("success"))
InitBadge();
还有就是我对收到如下方法代码广播:
public void onReceive(Context context, Intent intent)
{
Intent newintent = new Intent(context.getApplicationContext(),MainActivity.class);
newintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// newintent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
newintent.putExtra("receive", "success");
// newintent
context.startActivity(newintent);
}
什么你的代码有问题吗? InitBadge()不会被执行或其他什么? – 2014-08-30 11:34:57