Code example for Fragment

Methods: getActivity, loadPost, onResume

0
    private ImageButton viewPostButton;
    private ImageButton addCommentButton;
 
    @Override 
    public void onResume() { 
        super.onResume(); 
 
        if (WordPress.getCurrentPost() != null) { 
            loadPost(WordPress.getCurrentPost()); 
        } 
 
        parentActivity = (AbsListActivity) getActivity();
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
 
        View v = inflater.inflate(R.layout.viewpost, container, false);
 
        // button listeners here