Hi all,
Can anyone explain why, when I use the Final keyword the following code
works fine, but without it, it doesn't?

I just find it irritating that I don't understand why it works! ;)

Thanks in advance!

Tim.


public class PowerLangMaxMain extends Activity {

     private Button btnSave;

     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);

          final Builder builder = new AlertDialog.Builder(this);

         builder.setTitle("Confirm");
         builder.setMessage("Save to Database");
         builder.setPositiveButton("ok", null);
         builder.setNegativeButton("cancel", null);

         DBAdapter db = new DBAdapter(this);

         btnSave = (Button)findViewById(R.id.save_button);

         btnSave.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
           builder.show();
          }
         });
     }

}
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to