Fragment
Fragment可以当做是Activity的一个模块化组件。他拥有自己的生命周期、事件。并且可以在activity运行时动态加载和移除。 创建Fragment 创建Fragment,只需要继承Fragment类即可。 package com.xiao.residue.fg; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.xiao.residue.hw.R; /** * A simple {@link Fragment} subclass. */ public class frag_menu extends …