Skip to main content

Posts

Showing posts with the label alert dialogue

AlertBox Example in android

Alert Box in android  A dialogue is a small window that prompts the user to make decision or enter additional information.A dialogue does not fill the screen and is normally used for modal events that require users to take an action before they can proceed package com.example; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; public class AlertExampleActivity extends Activity {       /** Called when the activity is first created. */       @Override       public void onCreate(Bundle savedInstanceState) {             super .onCreate(savedInstanceState);             setContentView(R.layout. main );             Button button=(Button)findViewById(R.id. button1 );             button.setOnClickListener( new OnClickListener() {                   public void onClick(View