user17378410
user17378410

Reputation:

Why is onCreate() method not being called?

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: ");
    }
}

Upvotes: 0

Views: 58

Answers (1)

Muhamad DiarFadillah
Muhamad DiarFadillah

Reputation: 26

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

Upvotes: 1

Related Questions