diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2010-06-02 07:23:24 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2010-06-02 07:23:24 -0700 |
| commit | 740c3e2e97a4cca24ecb534de72663ced238156a (patch) | |
| tree | 94ed7b4e28009365960c7f6258f1d385604d1d05 /samples | |
| parent | 8cc5a8166dcdccfdb7f379a05190cef43f91c423 (diff) | |
| parent | 4b5c09f29e37c8d07dcba57e4c4da13089a9d63d (diff) | |
| download | android_development-740c3e2e97a4cca24ecb534de72663ced238156a.tar.gz android_development-740c3e2e97a4cca24ecb534de72663ced238156a.tar.bz2 android_development-740c3e2e97a4cca24ecb534de72663ced238156a.zip | |
merge from open-source master
Change-Id: I02c592cc054ac16e494ca7a34673ffb562287b01
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java | 21 | ||||
| -rw-r--r-- | samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java | 7 |
2 files changed, 14 insertions, 14 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java index de5f7112b..67141751b 100644 --- a/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java +++ b/samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java @@ -30,7 +30,7 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; import android.database.Cursor; -import android.provider.Contacts; +import android.provider.ContactsContract; import com.example.android.apis.R; @@ -186,13 +186,15 @@ public class AlertDialogSamples extends Activity { /* User clicked on a check box do some stuff */ } }) - .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.alert_dialog_ok, + new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked Yes so do some stuff */ } }) - .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() { + .setNegativeButton(R.string.alert_dialog_cancel, + new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked No so do some stuff */ @@ -201,17 +203,18 @@ 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 + ContactsContract.Contacts._ID, + ContactsContract.Contacts.DISPLAY_NAME, + ContactsContract.Contacts.SEND_TO_VOICEMAIL }; - Cursor cursor = managedQuery(Contacts.People.CONTENT_URI, projection, null, null, null); + Cursor cursor = managedQuery(ContactsContract.Contacts.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, + ContactsContract.Contacts.SEND_TO_VOICEMAIL, + ContactsContract.Contacts.DISPLAY_NAME, new DialogInterface.OnMultiChoiceClickListener() { public void onClick(DialogInterface dialog, int whichButton, boolean isChecked) { diff --git a/samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java b/samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java index dcb8b839a..e34f4cfea 100644 --- a/samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java +++ b/samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java @@ -20,14 +20,11 @@ import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; import android.content.IntentFilter; -import android.os.IBinder; import android.view.KeyEvent; -import android.provider.Contacts; +import android.provider.ContactsContract; import android.os.Bundle; import android.util.Log; -import java.util.Map; - /** * This is an example implementation of the {@link android.app.Instrumentation} * class, allowing you to run tests against application code. The @@ -61,7 +58,7 @@ public class ContactsSelectInstrumentation extends Instrumentation { // Monitor for the expected start activity call. ActivityMonitor am = addMonitor(IntentFilter.create( - Intent.ACTION_VIEW, Contacts.People.CONTENT_ITEM_TYPE), null, true); + Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_ITEM_TYPE), null, true); // We are going to enqueue a couple key events to simulate the user // selecting an item in the list. |
