HomeFragment.java:
public class HomeFragment extends Fragment {
FirebaseAuth fAuth;
String userId;
Button logout;
FirebaseFirestore fStore;
EditText name,no,mail;
public HomeFragment() {
}
public static HomeFragment newInstance(String param1, String param2) {
HomeFragment fragment = new HomeFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_home, container, false);
name=(EditText)view.findViewById(R.id.fname);
mail=(EditText)view.findViewById(R.id.emailid);
no=(EditText)view.findViewById(R.id.phone);
return view;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
}
我有我的 xml 文件(fragment_home.xml),其中包含三个我无法修改的 TextView,并且我的应用程序在尝试这样做时崩溃。我需要使用来自 firebase 的数据设置我的 textview。请帮我找到解决方案