1=> In Activity File (MainActivity.kt) : override fun onCreate (savedInstanceState: Bundle ?) { super .onCreate(savedInstanceState) setContentView( R . layout . activity_Main ) //method 2 for show dialog box val dialog =Dialog( this ) dialog .setContentView( R . layout . custom_dialog_box ); val btnOk = dialog .findViewById< Button >( R . id . btnOk ) if ( btnOk != null ) { btnOk .setOnClickListener( { Toast .makeText( this , "Success" , Toast . LENGTH_LONG ).show() dialog .dismiss() } )} dialog .show(); //method 2 for show dialog box // // val builder = AlertDialog.Builder(this) // val inflater = LayoutInflater.from(this) // val dialogView = inflater.inflate(R.layout.custom_dialog_box, null) // // builder.setView(dialogView) // // val dialog = builder.create() // dialog.show() } 2=> ...
EasyLearningTechHub is a smart learning platform created to make technology simple, practical, and accessible for everyone. 🚀 We focus on teaching in an easy, step-by-step way so learners can understand concepts clearly, even if they are beginners. Our content covers programming, mobile app development, software tools, and the latest tech trends with real-world examples and hands-on guidance. Our mission is to empower learners to grow, innovate, and achieve faster with EasyLearningTechHub. 🌟