MyFragmentPagerAdapter;
private list<fragment>fraglist;
private list<string>titlelist;
this.fraglist=fraglist;
this.titlelist;
getPageTitle(){
MyfragmentPager;
getsupportfragment;
PAGER.SETaDAPTER();
private list<fragment>fraglist;
private list<string>titlelist;
this.fraglist=fraglist;
this.titlelist;
getPageTitle(){
MyfragmentPager;
getsupportfragment;
PAGER.SETaDAPTER();
2015-01-27
private list<fragment>;
fraglist=new ;
fraglist.add(new fragment1())
fraglist.add(new fragment2());
fraglist.add(new fragment3());
fraglist=new ;
fraglist.add(new fragment1())
fraglist.add(new fragment2());
fraglist.add(new fragment3());
2015-01-27
tab.setBackgroundColor();
tab.setTextColor();
tab.setDrawfullUnderline();
tab.setTabIndicatorColor();
tab.findViewById;
tab.setTextColor();
tab.setDrawfullUnderline();
tab.setTabIndicatorColor();
tab.findViewById;
2015-01-27
private PagerTabStrip tab;
android.support.v4.view.PagerTabStrip
private list<string>
titlelist=new arraylist<string>();
titlelist.add;
titlelist.add;
getPageTitle;return titlelist.get position;
android.support.v4.view.PagerTabStrip
private list<string>
titlelist=new arraylist<string>();
titlelist.add;
titlelist.add;
getPageTitle;return titlelist.get position;
2015-01-27
MypagerAdapter extends PageR
int getCount();
View
private List<View> viewList;
public MyPagerAdapter
int getCount();
View
private List<View> viewList;
public MyPagerAdapter
2015-01-27
pagerAdapter
private list<View> viewlist;
viewlist=new arraylist<View>;
View view1=View.inflate(this,R.layout.View1,null);
viewlist.add(view1);
private list<View> viewlist;
viewlist=new arraylist<View>;
View view1=View.inflate(this,R.layout.View1,null);
viewlist.add(view1);
2015-01-27
<button>android width height;
text="fasong";
setConTENTvIEW(R.layout.main4);
private EditText editext;
private Button send;
editText send =findViewByiD
EDIText.getText().tostring();
text="fasong";
setConTENTvIEW(R.layout.main4);
private EditText editext;
private Button send;
editText send =findViewByiD
EDIText.getText().tostring();
2015-01-27
getactivity();
setArguments();
extents Activity{
onCreate(SavedInstance_);
<EditText>
id;
width;
height;
setArguments();
extents Activity{
onCreate(SavedInstance_);
<EditText>
id;
width;
height;
2015-01-27
onstart();
启动fragment
onresume();恢复fragment
暂停fragment;
停止fragment
onstop();
启动fragment
onresume();恢复fragment
暂停fragment;
停止fragment
onstop();
2015-01-27
fragment activity通信;
onAttach()
onAttach();当fragment被添加到activity时候会回调这个方法;一次
oncreate();
onactivitycreated(){
当fragment所在的
onAttach()
onAttach();当fragment被添加到activity时候会回调这个方法;一次
oncreate();
onactivitycreated(){
当fragment所在的
2015-01-27
动态加载:
处理fragment事物:commit();fragment addtobackstack();
BACK fragment
Myfragment2 new;
getFramentManager();
FragmentTransaction beginTransaction=fragment
beginTransaction.add(R.id.frame,fragment2);
beginTransaction.commit();
BEGINt燃烧cacti哦你。addtobackstack(null);
处理fragment事物:commit();fragment addtobackstack();
BACK fragment
Myfragment2 new;
getFramentManager();
FragmentTransaction beginTransaction=fragment
beginTransaction.add(R.id.frame,fragment2);
beginTransaction.commit();
BEGINt燃烧cacti哦你。addtobackstack(null);
2015-01-27
return view;
TextView text=view.find;
text.setTEXT();
SETcONtentView;
Intent intent=new intent(this,mainactivity2.calss);
startactivity(intent);Button button=findViewById;
button.setOnclicklistener(){
tv.setText();
TextView text=view.find;
text.setTEXT();
SETcONtentView;
Intent intent=new intent(this,mainactivity2.calss);
startactivity(intent);Button button=findViewById;
button.setOnclicklistener(){
tv.setText();
2015-01-27
加载方式 静态加载
inflater.inflate(r.layout.fragment,containner,false)
inflater.inflate(r.layout.fragment,containner,false)
2015-01-27