0

After logging in, I'm launching my next fragment like this:

getFragmentManager().beginTransaction()
                        .add(R.id.container, new MainMenuFragment())
                        .addToBackStack(null)
                        .commit();

The screen seems to be loading just fine, but the application closes immediately afterwards, and I can't find the reasonwhy.

The fragment has some buttons in a ConstraintLayout. The Fragment code is something like this: EDIT: full fragment

public class MainMenuFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_main_menu, container, false);
    final Button button = (Button) view.findViewById(R.id.buttonViewChallenges);
    button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
        }
    });

    final Button buttonAddObjective = (Button) view.findViewById(R.id.buttonAddObjective);
    buttonAddObjective.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {

        }
    });


    final Button buttonObjectiveList = (Button) view.findViewById(R.id.buttonViewObjectives);
    buttonObjectiveList.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {

        }
    });

    final Button buttonMyStats = (Button) view.findViewById(R.id.MyPerformances);
    buttonMyStats.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {

        }
    });

    final Button buttonAddChallenge = (Button) view.findViewById(R.id.AddChallengeID);
    buttonAddChallenge.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {

        }
    });
    return view;
    }
}

The application does not seem to crash, it simply stops.

logcat:

    06-02 10:36:13.617 13270-13270/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:13.659 13270-13270/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:13.659 13270-13270/? E/android.os.Debug: failed to load memtrack module: -2
    06-02 10:36:13.934 13288-13288/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:13.971 13288-13288/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:13.971 13288-13288/? E/android.os.Debug: failed to load memtrack module: -2
    06-02 10:36:14.332 13307-13307/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:14.366 13307-13307/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:14.366 13307-13307/? E/android.os.Debug: failed to load memtrack module: -2
    06-02 10:36:17.469 13319-13319/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:17.527 13319-13319/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:17.527 13319-13319/? E/android.os.Debug: failed to load memtrack module: -2
    06-02 10:36:17.532 13322-13322/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:17.588 13322-13322/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:17.588 13322-13322/? E/android.os.Debug: failed to load memtrack module: -2
    06-02 10:36:17.629 13340-13347/? E/art: Failed sending reply to debugger: Broken pipe
    06-02 10:36:17.904 13356-13356/? E/cutils-trace: Error opening trace file: Permission denied (13)
    06-02 10:36:17.939 13356-13356/? E/memtrack: Couldn't load memtrack module (No such file or directory)
    06-02 10:36:17.939 13356-13356/? E/android.os.Debug: failed to load memtrack module: -2

06-02 10:36:21.199 1258-2285/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
06-02 10:36:36.577 1258-1258/? E/EGL_emulation: tid 1258: eglCreateSyncKHR(1451): error 0x3004 (EGL_BAD_ATTRIBUTE)
Lorena Sfăt
  • 215
  • 2
  • 7
  • 18

0 Answers0