merge from open-source master
Change-Id: I02c592cc054ac16e494ca7a34673ffb562287b01
This commit is contained in:
@@ -30,7 +30,7 @@ import android.view.View.OnClickListener;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.provider.Contacts;
|
import android.provider.ContactsContract;
|
||||||
|
|
||||||
import com.example.android.apis.R;
|
import com.example.android.apis.R;
|
||||||
|
|
||||||
@@ -186,13 +186,15 @@ public class AlertDialogSamples extends Activity {
|
|||||||
/* User clicked on a check box do some stuff */
|
/* 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) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
|
||||||
/* User clicked Yes so do some stuff */
|
/* 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) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
|
||||||
/* User clicked No so do some stuff */
|
/* User clicked No so do some stuff */
|
||||||
@@ -201,17 +203,18 @@ public class AlertDialogSamples extends Activity {
|
|||||||
.create();
|
.create();
|
||||||
case DIALOG_MULTIPLE_CHOICE_CURSOR:
|
case DIALOG_MULTIPLE_CHOICE_CURSOR:
|
||||||
String[] projection = new String[] {
|
String[] projection = new String[] {
|
||||||
Contacts.People._ID,
|
ContactsContract.Contacts._ID,
|
||||||
Contacts.People.NAME,
|
ContactsContract.Contacts.DISPLAY_NAME,
|
||||||
Contacts.People.SEND_TO_VOICEMAIL
|
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)
|
return new AlertDialog.Builder(AlertDialogSamples.this)
|
||||||
.setIcon(R.drawable.ic_popup_reminder)
|
.setIcon(R.drawable.ic_popup_reminder)
|
||||||
.setTitle(R.string.alert_dialog_multi_choice_cursor)
|
.setTitle(R.string.alert_dialog_multi_choice_cursor)
|
||||||
.setMultiChoiceItems(cursor,
|
.setMultiChoiceItems(cursor,
|
||||||
Contacts.People.SEND_TO_VOICEMAIL,
|
ContactsContract.Contacts.SEND_TO_VOICEMAIL,
|
||||||
Contacts.People.NAME,
|
ContactsContract.Contacts.DISPLAY_NAME,
|
||||||
new DialogInterface.OnMultiChoiceClickListener() {
|
new DialogInterface.OnMultiChoiceClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton,
|
public void onClick(DialogInterface dialog, int whichButton,
|
||||||
boolean isChecked) {
|
boolean isChecked) {
|
||||||
|
|||||||
@@ -20,14 +20,11 @@ import android.app.Activity;
|
|||||||
import android.app.Instrumentation;
|
import android.app.Instrumentation;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.os.IBinder;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.provider.Contacts;
|
import android.provider.ContactsContract;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an example implementation of the {@link android.app.Instrumentation}
|
* This is an example implementation of the {@link android.app.Instrumentation}
|
||||||
* class, allowing you to run tests against application code. The
|
* 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.
|
// Monitor for the expected start activity call.
|
||||||
ActivityMonitor am = addMonitor(IntentFilter.create(
|
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
|
// We are going to enqueue a couple key events to simulate the user
|
||||||
// selecting an item in the list.
|
// selecting an item in the list.
|
||||||
|
|||||||
Reference in New Issue
Block a user