我的应用程序的设计有点不同..getExtras总是空?
Activity--> Activity---> B ----> Activity c ---- Activity D
之后,它应该像
ActvityD--> Activity A
在活动d:
Intent intent= new Intent(D.this,A.class);
Bundle bundle= new Bundle();
bundle.putString(Constant.AB , "ABCD");
intent.putExtras(bundle);
startActivity(intent);
在活动A
的OnStart
Intent intent= getIntent();
Bundle extras =intent.getExtras();
if (extras != null)
{
String val = getIntent().getStringExtra(Constant.AB);
if(val.equals("ABCD")){
m_myApp.getCurrentPlaybackHelper(1);
Log.e(TAG,"Remote play is working");
}
}
临时演员永远是null.did我想念什么?
如果A已经启动,可能会查看'onNewIntent'? – njzk2 2014-11-06 18:03:06
@ njzk2非常感谢你 – Asthme 2014-11-06 18:21:33