diff --git a/samples/Support7Demos/AndroidManifest.xml b/samples/Support7Demos/AndroidManifest.xml
index f358bf772..a84dc225f 100644
--- a/samples/Support7Demos/AndroidManifest.xml
+++ b/samples/Support7Demos/AndroidManifest.xml
@@ -298,6 +298,15 @@
+
+
+
+
+
+
+
diff --git a/samples/Support7Demos/res/layout/alert_dialog_usage.xml b/samples/Support7Demos/res/layout/alert_dialog_usage.xml
new file mode 100644
index 000000000..9c6dee637
--- /dev/null
+++ b/samples/Support7Demos/res/layout/alert_dialog_usage.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/Support7Demos/res/values/arrays.xml b/samples/Support7Demos/res/values/arrays.xml
index 9ffa6df9a..c4d398725 100644
--- a/samples/Support7Demos/res/values/arrays.xml
+++ b/samples/Support7Demos/res/values/arrays.xml
@@ -35,4 +35,11 @@
- Button bar
+
+ - Simple
+ - Simple with buttons
+ - List (single choice)
+ - List (multi choice)
+
+
diff --git a/samples/Support7Demos/res/values/strings.xml b/samples/Support7Demos/res/values/strings.xml
index 1a56e0978..348014295 100644
--- a/samples/Support7Demos/res/values/strings.xml
+++ b/samples/Support7Demos/res/values/strings.xml
@@ -135,6 +135,7 @@
AppCompat/Dialog/Dialog Usage
My great dialog
My great dialog is great
+ AppCompat/Dialog/AlertDialog Usage
Remote Playback (Simulated)
Local Playback
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/app/AlertDialogUsage.java b/samples/Support7Demos/src/com/example/android/supportv7/app/AlertDialogUsage.java
new file mode 100644
index 000000000..560111b2e
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/app/AlertDialogUsage.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.supportv7.app;
+
+import com.example.android.supportv7.Cheeses;
+import com.example.android.supportv7.R;
+
+import android.os.Bundle;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.Spinner;
+
+/**
+ * This demonstrates idiomatic usage of AppCompat's AlertDialog.
+ */
+public class AlertDialogUsage extends AppCompatActivity {
+
+ private Spinner mSpinner;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.alert_dialog_usage);
+
+ mSpinner = (Spinner) findViewById(R.id.spinner_dialogs);
+
+ // Add an OnClickListener to show our selected dialog
+ findViewById(R.id.btn_show_dialog).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ showSelectedDialog();
+ }
+ });
+ }
+
+ private void showSelectedDialog() {
+ switch (mSpinner.getSelectedItemPosition()) {
+ case 0:
+ showSimpleDialog();
+ break;
+ case 1:
+ showSimpleButtonsDialog();
+ break;
+ case 2:
+ showSingleChoiceDialog();
+ break;
+ case 3:
+ showMultiChoiceDialog();
+ break;
+ }
+ }
+
+ private void showSimpleDialog() {
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setTitle(R.string.dialog_title);
+ b.setMessage(R.string.dialog_content);
+ b.show();
+ }
+
+ private void showSimpleButtonsDialog() {
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setTitle(R.string.dialog_title);
+ b.setMessage(R.string.dialog_content);
+ b.setNegativeButton("-ve", null);
+ b.setPositiveButton("+ve", null);
+ b.show();
+ }
+
+ private void showSingleChoiceDialog() {
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setTitle(R.string.dialog_title);
+ b.setSingleChoiceItems(Cheeses.sCheeseStrings, 0, null);
+ b.setPositiveButton("OK", null);
+ b.show();
+ }
+
+ private void showMultiChoiceDialog() {
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setTitle(R.string.dialog_title);
+ b.setMultiChoiceItems(Cheeses.sCheeseStrings, null, null);
+ b.setPositiveButton("OK", null);
+ b.show();
+ }
+
+
+}