2014-09-28 31 views
0

IM發送數據從一類到FragmentActivity這樣的:通行證羣衆演員FragmentActivity其空

public class OpenReportAction extends Action { 
    private WorkActivity listener; 

    public OpenReportAction(Activity listener) throws BadListenerException { 
     if (!(listener instanceof WorkActivity)) { 
      throw new BadListenerException("Listener must be context of WorkActivity"); 
     } 
     this.listener = (WorkActivity) listener; 
    } 

    @Override 
    public void execute(List<Report> reports, Questions question) { 
     Intent replyIntent = new Intent(listener, ReplyActivity.class); 
     replyIntent.putExtra("id", listener.getWork().getID()); 
     replyIntent.putExtra("questions", question); 
     replyIntent.putParcelableArrayListExtra("reports", (ArrayList<Report>) reports); 
     listener.openReportOk(question); 
     listener.startActivity(replyIntent); 
    } 

    public interface ReportCreatedCallback { 
     void openReportOk(Questions question); 

     void openReportError(WorkActionError cause); 
    } 
} 

,我得到這樣的數據:

@Override 
     protected void onCreate(Bundle savedInstanceState) { 
      super.onCreate(savedInstanceState); 
      getWindow().requestFeature(Window.FEATURE_ACTION_BAR); 
      setContentView(R.layout.reply_activity); 
      getData(getIntent()); 
      setFragment(); 
     } 
private void getData(Intent data) { 
     ID = data.getLongExtra("id", 0); 
     questions = data.getParcelableExtra("questions"); 
     reports = data.getParcelableArrayListExtra("reports"); 
    } 

但裏面FragmentActivity(ReplyActivity)額外的東西都是空的..我怎麼能得到它?

+0

發佈您的代碼,在其中閱讀活動中的額外信息 – JafarKhQ 2014-09-28 13:55:11

+0

「launchMode」標誌是什麼?嘗試覆蓋'onNewIntent(Intent)'並查看它是否被觸發。 – Kai 2014-09-28 14:18:08

+0

它沒有被解僱......:S – colymore 2014-09-28 16:44:28

回答

0

確保「報告」額外不是一個大對象。大對象無法超越意圖。 提示:如果是這種情況,您將看到類似於以下內容的日誌:「JAVA BINDER FAILURE」