里奥文
2018-02-13 11:18Android开发,从Fragment中跳转到其他Activity后只显示空白的活动
20准备实现的功能是点击售后服务后跳转到Guarantee这个类中。public class ThirdFragment extends Fragment implements View.OnClickListener{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.third_fragment, container, false);
LinearLayout guaranteell = (LinearLayout) view.findViewById(R.id.serviceGuaranteeId);
guaranteell.setOnClickListener(this);
return view;
}
@Override
public void onClick(View view){
Intent intent = new Intent(getActivity(), Guarantee.class);
startActivity(intent);
Guarantee.class的代码如下
```public class Guarantee extends AppCompatActivity {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view = inflater.inflate(R.layout.activity_guarantee, container, false);
//setContentView(R.layout.activity_guarantee);
return view;
}
}```
- 点赞
- 回答
- 收藏
- 复制链接分享
8条回答
为你推荐
- 求大神解答从Fragment中的按钮跳转至另一个页面的问题
- 控件
- android
- setonclicklistener
- fragment
- 3个回答
- 跳转到新的ACTIVITY,tabhost当前选项卡显示为空
- tabhost
- tabcontent
- feagment
- 2个回答