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.