1

クラス TitleView extends LinearLayout にボタンを追加しました。このクラスが必要なサーバル UI があるため、それらのレイアウト xml ファイルに含めました。ボタンが押された後に PreferenceFragment を開始する必要がありますが、getFragmentManager() を使用して FragmentManager を取得し、TitleView で PreferenceFragment を制御することはできません。

誰でも私を助けることができますか?どうもありがとう :)

4

1 に答える 1

2
class TitleView extends LinearLayout
{

    private FragmentActivity mActivity;

    /**
     * @param of type null
     * @return mActivity of type FragmentActivity
     * getter function for mActivity
     * @since May 3, 2013 
     * @author rajeshcp 
     */
    public FragmentActivity getmActivity() {
        return mActivity;
    }

    /**
     * @param mActivity of type FragmentActivity
     * @return of type null
     * setter function for mActivity
     * @since May 3, 2013
     * @author rajeshcp 
     */
    public void setmActivity(FragmentActivity mActivity) {
        this.mActivity = mActivity;
        mActivity.getSupportFragmentManager();
    }

    public TitleView(Context context) {
        super(context);
    }

}

((TitleView)findViewbyId(R.id.your_lay_out_id)).setmActivity(yourFragmentActivity);

mActivity.getSupportFragmentManager();
于 2013-05-03T07:33:13.413 に答える