Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - AlertDialog, Preferences, Builder, PopUp

AlertDialog, Preferences, Builder, PopUp

Quickly share your Android Code Snippets here...

AlertDialog, Preferences, Builder, PopUp

Postby plusminus » Sun Nov 09, 2008 5:07 pm

Tip: Strongly suggested to make the used Strings constants :!:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. new AlertDialog.Builder(this).setMessage("Save to Pref...")
  2. .setPositiveButton("SAVE", new DialogInterface.OnClickListener(){
  3.         @Override
  4.         public void onClick(DialogInterface dialog, int which) {
  5.                 Editor e = YOUR_SURROUNDING_ACTIVITY.this.getPreferences(Context.MODE_PRIVATE).edit();
  6.                 e.putString("PREFERENCES_ID", "hello world");
  7.                 e.commit();
  8.                 dialog.dismiss();
  9.         }
  10. }).setNegativeButton("CANCEL", new DialogInterface.OnClickListener(){
  11.         @Override
  12.         public void onClick(DialogInterface dialog, int which) {
  13.                 dialog.dismiss();
  14.         }
  15. }).show();
Parsed in 0.018 seconds, using GeSHi 1.0.8.4

SDK Version compatible: 1.0 (maybe prior versions too)
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 4 guests