InboxDetailActivity.java
:NullPointerException異常getExtras()的getString( 「到」)
Intent i = new Intent(InboxDetailActivity.this,Compose.class);
Bundle b = new Bundle();
b.putString("To", ConstantData.inbox_from);
Log.d("From Value", ConstantData.inbox_from);
b.putString("Subject", "RE:" + ConstantData.inbox_subject);
Log.d("Subject Value", ConstantData.inbox_subject);
b.putString("FromId", ConstantData.inbox_fromid);
Log.d("From Id Value",ConstantData.inbox_fromid);
i.putExtras(b);
startActivity(i);
Compose.java
:
Intent i = getIntent();
Bundle b = i.getExtras();
to = b.getString("To");
subject = b.getString("Subject");
toId = b.getString("FromId");
我在to = b.getString("To");
的'Intent.putExtras(束)'方法說,「鑰匙必須包括一個包前綴「。您能否重試示例代碼以考慮這一點? – 2011-04-09 06:49:57