Back to project page introToDroid4ed.
The source code is released under:
GNU General Public License
If you think the Android project introToDroid4ed listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.introtoandroid.advancedlayouts; //from w ww . j a v a 2 s . c o m import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.View; import android.widget.Button; public class DialogActivity extends Activity { @Override protected void onCreate( Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.dialog); Button b = (Button)findViewById(R.id.do_dialog_btn); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new AlertDialog.Builder(DialogActivity.this) .setMessage("Press agree to continue...") .setPositiveButton("Agree", null) .show(); } }); } }