Code example for FragmentActivity

Methods: setResult, setTitle

0
	 
	@Override 
	public void onPostView(int post_id, int post_xid) {
		if (postlistFrag != null)
			postlistFrag.onPostView(post_id, post_xid);
		setTitle(pref.getString("board", "") + " - " + post_id);
		last_post_id = post_id;
		last_post_xid = post_xid;
		post_viewed.add(post_xid);
		updateResult(); 
	} 
	 
	@Override 
	public void onPostReply() { 
		if (postlistFrag != null)
			postlistFrag.onPostReply();
		replied = true;
		updateResult(); 
	} 
	 
    private void updateResult() { 
    	Intent data = new Intent(this, PostListActivity.class);
    	Bundle extras = new Bundle();
    	extras.putInt("id", last_post_id);
    	extras.putInt("xid", last_post_xid);
    	extras.putIntegerArrayList("post_viewed", post_viewed);
    	extras.putBoolean("replied", replied);
 
    	data.putExtras(extras);
 
    	setResult(Activity.RESULT_OK, data);
    } 
}