summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-06-02 07:27:39 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-06-02 07:27:39 -0700
commit74a0b220620c4d328ff05fc6f8c7ce64e00d7091 (patch)
tree436f61ba44b7e737610e6726bb982a65e2b6df9a /samples
parent85c4a21b9ed24be5bc983f321a73dbb7d12f997f (diff)
parent740c3e2e97a4cca24ecb534de72663ced238156a (diff)
downloadandroid_development-74a0b220620c4d328ff05fc6f8c7ce64e00d7091.tar.gz
android_development-74a0b220620c4d328ff05fc6f8c7ce64e00d7091.tar.bz2
android_development-74a0b220620c4d328ff05fc6f8c7ce64e00d7091.zip
am 740c3e2e: merge from open-source master
Merge commit '740c3e2e97a4cca24ecb534de72663ced238156a' into kraken * commit '740c3e2e97a4cca24ecb534de72663ced238156a': Updated deprecated Contacts API to ContactsContract
Diffstat (limited to 'samples')
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/app/AlertDialogSamples.java21
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/app/ContactsSelectInstrumentation.java7
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.