Android鸟舍转换为片段

时间:2014-12-02 04:14:13

标签: java android fragment onresume aviary

如何转换下面的代码,以便它可以在Fragment中使用。

@Override
protected void onResume() {
    Log.i( LOG_TAG, "onResume" );
    super.onResume();

    if ( getIntent() != null ) {
        handleIntent( getIntent() );
        setIntent( new Intent() );
    }
}

我试过这个。但它没有用。

public void onResume() {
    Log.i( LOG_TAG, "onResume" );
    super.onResume();

    if ( getActivity().getIntent() != null ) {
        handleIntent( getActivity().getIntent() );
        getActivity().setIntent( new Intent() );
    }
}

0 个答案:

没有答案