准备实现的功能是点击售后服务后跳转到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;
}
}```