-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainFragment.java
More file actions
37 lines (28 loc) · 902 Bytes
/
Copy pathMainFragment.java
File metadata and controls
37 lines (28 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.miaoyi.work.fragment;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.miaoyi.work.R;
/**
* Created by administrato on 2016/8/23.
*/
public class MainFragment extends BaseFragment {
public static MainFragment newInstance() {
MainFragment fragment = new MainFragment();
return fragment;
}
@Override
protected void initView(View view, Bundle savedInstanceState) {
Button button = (Button) view.findViewById(R.id.btn_add_Fragment);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
addFragment(SecondFragment.newInstance(), "第二个");
}
});
}
@Override
protected int getLayoutId() {
return R.layout.fragment_main;
}
}