No view found for id error occurred in flexible layout of fragment ui.

Application entry Main.java :

public class Main extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.frame);
        FragmentManager fm = this.getSupportFragmentManager();
        Fragment fragment = fm.findFragmentById(R.id.fragment_container);
        if (fragment == null) {
            fragment = new com.note.note.Crime();
            fm.beginTransaction()
                    .add(R.id.fragment_container , fragment)
                    .commit();
        }
    }
}

fragment corresponding Crime.java (package: com.note.note) File:

public class Crime extends Fragment {
    @Override
    public View onCreateView(LayoutInflater inflater , ViewGroup container , Bundle state)
    {
        return inflater.inflate(R.layout.add , container , false);
    }
}

error report after running:

No view found for id 0x7f07003e (com.note.note:id/fragment_container) for fragment Crime{5aacf1c -sharp0 id=0x7f07003e}

what is this? why? What can I do to correct this mistake?

Jun.06,2022

just new the Fragment directly

// 
Fragment fragment = fm.findFragmentById(R.id.fragment_container);
// 
Fragment f = new Crime(); 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47d67-4c36f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47d67-4c36f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?