package com.example.fragment; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.smartglasses.R; import com.example.smartglasses.databinding.FragmentTraceBinding; public class TraceFragment extends Fragment { FragmentTraceBinding binding; private String[] titles = {"今天","昨天"}; public TraceFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment binding = FragmentTraceBinding.inflate(inflater, container, false); binding.easyIndicator2.setTabTitles(titles); return binding.getRoot(); } }