我有一个奇怪的问题,当我打开某个片段时,我的应用程序会自动将我注销。我什至尝试注释掉所有代码以阻止这种情况发生,但问题仍然存在。我已经为片段包含了我的空类和 XML。我只能假设这是我忽略的一个愚蠢的问题,但我已经尝试找到答案好几天了。
感谢任何帮助
fragment_edit_profile
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/profileImage"
android:layout_marginTop="25dp"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/profileImage"
android:layout_centerHorizontal="true"
android:text="Change profile picture"
android:textSize="18sp"
android:id="@+id/changeProfilePictureTextView"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="50dp"
android:layout_below="@id/changeProfilePictureTextView"
android:background="@drawable/white_and_grey_border_bottom"
android:id="@+id/relativeLayout1">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_action_compose"
android:layout_centerVertical="true"/>
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="45dp"
android:id="@+id/usernameEditTextEditProfile"
android:hint="@string/change_username"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="50dp"
android:layout_below="@id/relativeLayout1"
android:background="@drawable/white_and_grey_border_bottom"
android:id="@+id/relativeLayout2">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_action_compose"
android:layout_centerVertical="true"/>
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="45dp"
android:hint="Change email address"
android:id="@+id/emailEditTextEditProfile"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="50dp"
android:layout_below="@id/relativeLayout2"
android:background="@drawable/white_and_grey_border_bottom"
android:id="@+id/relativeLayout3">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_action_compose"
android:layout_centerVertical="true"
android:id="@+id/imageView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="45dp"
android:layout_centerVertical="true"
android:text="Click here to reset password"
android:textStyle="italic"
android:textSize="18sp"
android:id="@+id/changePassword"/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
EditPrfileFragment
public class EditProfileFragment extends Fragment implements View.OnClickListener {
private static final String TAG = "EditProfileFragment";
String password;
String passwordConfirm;
private EditText passwordEditText;
private EditText passwordConfirmEditText;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_edit_profile, container, false);
return view;
}
@Override
public void onClick(View v) {
}