Why is onCreate() method not being called?

56 Views Asked by At

I made a new class and I wanted to make an OnClickListener for a button but I notice that the onCreate wasn't being called. Any help is appreciated.

public class BedtimeBottomSheet extends Activity {

    private static final String TAG = "BedtimeBottomSheet";


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.d(TAG, "onCreate: ");
    }
}
1

There are 1 best solutions below

0
Muhamad DiarFadillah On

Consider that you should use setContentView(binding.getRoot()); in your onCreate method.