Skip to main content

Posts

Showing posts from 2012

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

Progressbar example in android

Progress bar In android, progress bar can be used to tell the user the task takes longer time to finish. Progress  bar displays a bar which represent how far the operations has progressed. Progress bar can be made indeterminate. In indeterminate mode, progress bar shows a cyclic animation without indication progress. In this tutorial, I’ll show how to display a progress bar  package com.example; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.widget.ProgressBar; import android.widget.TextView; public class ProgressbarExamplActivity extends Activity {       private ProgressBar bar ;       private TextView txt ;       protected boolean isRunning ;       /** Called when the activity is first created. */       @Override       public void onCreate(Bundle savedInstanceState) {             super .onCreate(savedInstanceState);             setContentView(R.layout. main );             bar =(ProgressB