OSDN Git Service

am 098a5264: Merge "SDK Manager: post install script to update SDK Setup.exe" into...
authorRaphael Moll <raphael@google.com>
Sat, 30 Jan 2010 01:22:29 +0000 (17:22 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Sat, 30 Jan 2010 01:22:29 +0000 (17:22 -0800)
Merge commit '098a5264920e089ec6958f8c74dd0983eda5bc0f' into eclair-plus-aosp

* commit '098a5264920e089ec6958f8c74dd0983eda5bc0f':
  SDK Manager: post install script to update SDK Setup.exe

ide/eclipse/.classpath
samples/ApiDemos/res/layout/alert_dialog.xml
samples/ApiDemos/res/values/strings.xml
samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java

index 71694d4..16f5b44 100644 (file)
@@ -23,7 +23,6 @@
        <classpathentry kind="src" path="packages/providers/ContactsProvider/src"/>
        <classpathentry kind="src" path="packages/providers/DownloadProvider/src"/>
        <classpathentry kind="src" path="packages/providers/DrmProvider/src"/>
-       <classpathentry kind="src" path="packages/providers/ImProvider/src"/>
        <classpathentry kind="src" path="packages/providers/MediaProvider/src"/>
        <classpathentry kind="src" path="packages/providers/TelephonyProvider/src"/>
        <classpathentry kind="src" path="frameworks/base/awt"/>
@@ -48,6 +47,7 @@
        <classpathentry kind="src" path="frameworks/base/tts/java"/>
        <classpathentry kind="src" path="frameworks/base/vpn/java"/>
        <classpathentry kind="src" path="frameworks/base/wifi/java"/>
+       <classpathentry kind="src" path="frameworks/base/vpn/java"/>
        <classpathentry kind="src" path="frameworks/policies/base/phone"/>
        <classpathentry kind="src" path="development/samples/ApiDemos/src"/>
        <classpathentry kind="src" path="development/samples/ApiDemos/tests/src"/>
        <classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/telephony/java"/>
        <classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/vpn/java"/>
        <classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/wifi/java"/>
+       <classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/vpn/java"/>
        <classpathentry kind="src" path="out/target/common/R"/>
        <classpathentry kind="src" path="external/tagsoup/src"/>
        <classpathentry kind="src" path="external/protobuf/src"/>
index ddd5cb6..741be33 100644 (file)
@@ -41,6 +41,9 @@
         <Button android:id="@+id/checkbox_button"
             android:layout_width="fill_parent" android:layout_height="wrap_content"
             android:text="@string/alert_dialog_multi_choice"/>
+        <Button android:id="@+id/checkbox_button2"
+            android:layout_width="fill_parent" android:layout_height="wrap_content"
+            android:text="@string/alert_dialog_multi_choice_cursor"/>
         <Button android:id="@+id/text_entry_button"
             android:layout_width="fill_parent" android:layout_height="wrap_content"
             android:text="@string/alert_dialog_text_entry"/>
index b19504b..bdcb7a7 100644 (file)
     <string name="alert_dialog_select_button">List dialog</string>
     <string name="alert_dialog_single_choice">Single choice list</string>
     <string name="alert_dialog_multi_choice">Repeat alarm</string>
+    <string name="alert_dialog_multi_choice_cursor">Send Call to VoiceMail</string>
     <string name="alert_dialog_progress_button">Progress dialog</string>
     <string name="alert_dialog_text_entry">Text Entry dialog</string>
     <string name="alert_dialog_username">Name:</string>
index fabdfc1..0ef79b3 100644 (file)
@@ -28,6 +28,9 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
+import android.widget.Toast;
+import android.database.Cursor;
+import android.provider.Contacts;
 
 import com.example.android.apis.R;
 
@@ -60,6 +63,7 @@ public class AlertDialogSamples extends Activity {
     private static final int DIALOG_SINGLE_CHOICE = 5;
     private static final int DIALOG_MULTIPLE_CHOICE = 6;
     private static final int DIALOG_TEXT_ENTRY = 7;
+    private static final int DIALOG_MULTIPLE_CHOICE_CURSOR = 8;
 
     private static final int MAX_PROGRESS = 100;
     
@@ -193,6 +197,28 @@ public class AlertDialogSamples extends Activity {
                     }
                 })
                .create();
+            case DIALOG_MULTIPLE_CHOICE_CURSOR:
+                String[] projection = new String[] {
+                        Contacts.People._ID,
+                        Contacts.People.NAME,
+                        Contacts.People.SEND_TO_VOICEMAIL
+                };
+                Cursor cursor = managedQuery(Contacts.People.CONTENT_URI, projection, null, null, null);
+                return new AlertDialog.Builder(AlertDialogSamples.this)
+                    .setIcon(R.drawable.ic_popup_reminder)
+                    .setTitle(R.string.alert_dialog_multi_choice_cursor)
+                    .setMultiChoiceItems(cursor,
+                            Contacts.People.SEND_TO_VOICEMAIL,
+                            Contacts.People.NAME,
+                            new DialogInterface.OnMultiChoiceClickListener() {
+                                public void onClick(DialogInterface dialog, int whichButton,
+                                        boolean isChecked) {
+                                    Toast.makeText(AlertDialogSamples.this,
+                                            "Readonly Demo Only - Data will not be updated",
+                                            Toast.LENGTH_SHORT).show();
+                                }
+                            })
+                   .create();
         case DIALOG_TEXT_ENTRY:
             // This example shows how to add a custom layout to an AlertDialog
             LayoutInflater factory = LayoutInflater.from(this);
@@ -281,6 +307,14 @@ public class AlertDialogSamples extends Activity {
             }
         });
         
+        /* Display a list of checkboxes, backed by a cursor */
+        Button checkBox2 = (Button) findViewById(R.id.checkbox_button2);
+        checkBox2.setOnClickListener(new OnClickListener() {
+            public void onClick(View v) {
+                showDialog(DIALOG_MULTIPLE_CHOICE_CURSOR);
+            }
+        });
+
         /* Display a text entry dialog */
         Button textEntry = (Button) findViewById(R.id.text_entry_button);
         textEntry.setOnClickListener(new OnClickListener() {