The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.contacts; |
| 18 | |
Jeff Sharkey | 802b205 | 2009-08-04 14:21:06 -0700 | [diff] [blame] | 19 | import com.android.contacts.ui.FastTrackWindow; |
Jeff Sharkey | 49d17b3 | 2009-09-07 02:14:21 -0700 | [diff] [blame] | 20 | import com.android.contacts.util.Constants; |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 21 | import com.android.contacts.util.NotifyingAsyncQueryHandler; |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 22 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 23 | import android.app.Activity; |
| 24 | import android.app.AlertDialog; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 25 | import android.content.ComponentName; |
| 26 | import android.content.ContentUris; |
| 27 | import android.content.DialogInterface; |
Evan Millar | 5f4af70 | 2009-08-11 11:12:00 -0700 | [diff] [blame] | 28 | import android.content.EntityIterator; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 29 | import android.content.Intent; |
| 30 | import android.database.Cursor; |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 31 | import android.graphics.Rect; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 32 | import android.net.Uri; |
| 33 | import android.os.Bundle; |
Dmitri Plotnikov | e1cd679 | 2009-07-27 20:28:17 -0700 | [diff] [blame] | 34 | import android.provider.ContactsContract.Contacts; |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 35 | import android.provider.ContactsContract.Intents; |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 36 | import android.provider.ContactsContract.PhoneLookup; |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 37 | import android.provider.ContactsContract.RawContacts; |
Jeff Sharkey | 2409705 | 2009-08-24 15:27:31 -0700 | [diff] [blame] | 38 | import android.provider.ContactsContract.CommonDataKinds.Email; |
Jeff Sharkey | 73714ff | 2009-08-23 22:13:04 -0700 | [diff] [blame] | 39 | import android.util.Log; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 40 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 41 | /** |
| 42 | * Handle several edge cases around showing or possibly creating contacts in |
| 43 | * connected with a specific E-mail address or phone number. Will search based |
| 44 | * on incoming {@link Intent#getData()} as described by |
Jeff Sharkey | 73714ff | 2009-08-23 22:13:04 -0700 | [diff] [blame] | 45 | * {@link Intents#SHOW_OR_CREATE_CONTACT}. |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 46 | * <ul> |
| 47 | * <li>If no matching contacts found, will prompt user with dialog to add to a |
| 48 | * contact, then will use {@link Intent#ACTION_INSERT_OR_EDIT} to let create new |
| 49 | * contact or edit new data into an existing one. |
Jeff Sharkey | 73714ff | 2009-08-23 22:13:04 -0700 | [diff] [blame] | 50 | * <li>If one matching contact found, show the {@link FastTrackWindow} |
| 51 | * associated with the found contact. Will show translucent over the caller. |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 52 | * <li>If more than one matching found, show list of matching contacts using |
| 53 | * {@link Intent#ACTION_SEARCH}. |
| 54 | * </ul> |
| 55 | */ |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 56 | public final class ShowOrCreateActivity extends Activity implements |
| 57 | NotifyingAsyncQueryHandler.AsyncQueryListener, FastTrackWindow.OnDismissListener { |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 58 | static final String TAG = "ShowOrCreateActivity"; |
| 59 | static final boolean LOGD = false; |
| 60 | |
| 61 | static final String[] PHONES_PROJECTION = new String[] { |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 62 | PhoneLookup._ID, |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 65 | static final String[] CONTACTS_PROJECTION = new String[] { |
Dmitri Plotnikov | e1cd679 | 2009-07-27 20:28:17 -0700 | [diff] [blame] | 66 | RawContacts.CONTACT_ID, |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 67 | }; |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 68 | |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 69 | static final int AGGREGATE_ID_INDEX = 0; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 70 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 71 | static final int QUERY_TOKEN = 42; |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 72 | |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 73 | private NotifyingAsyncQueryHandler mQueryHandler; |
| 74 | |
| 75 | private Bundle mCreateExtras; |
| 76 | private String mCreateDescrip; |
| 77 | private boolean mCreateForce; |
| 78 | |
| 79 | private FastTrackWindow mFastTrack; |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 80 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 81 | @Override |
| 82 | protected void onCreate(Bundle icicle) { |
| 83 | super.onCreate(icicle); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 84 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 85 | // Create handler if doesn't exist, otherwise cancel any running |
| 86 | if (mQueryHandler == null) { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 87 | mQueryHandler = new NotifyingAsyncQueryHandler(this, this); |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 88 | } else { |
| 89 | mQueryHandler.cancelOperation(QUERY_TOKEN); |
| 90 | } |
| 91 | |
| 92 | final Intent intent = getIntent(); |
| 93 | final Uri data = intent.getData(); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 94 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 95 | // Unpack scheme and target data from intent |
| 96 | String scheme = null; |
| 97 | String ssp = null; |
| 98 | if (data != null) { |
| 99 | scheme = data.getScheme(); |
| 100 | ssp = data.getSchemeSpecificPart(); |
| 101 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 102 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 103 | // Build set of extras for possible use when creating contact |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 104 | mCreateExtras = new Bundle(); |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 105 | Bundle originalExtras = intent.getExtras(); |
| 106 | if (originalExtras != null) { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 107 | mCreateExtras.putAll(originalExtras); |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 108 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 109 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 110 | // Read possible extra with specific title |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 111 | mCreateDescrip = intent.getStringExtra(Intents.EXTRA_CREATE_DESCRIPTION); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 112 | if (mCreateDescrip == null) { |
| 113 | mCreateDescrip = ssp; |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 114 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 115 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 116 | // Allow caller to bypass dialog prompt |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 117 | mCreateForce = intent.getBooleanExtra(Intents.EXTRA_FORCE_CREATE, false); |
| 118 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 119 | // Handle specific query request |
Jeff Sharkey | 49d17b3 | 2009-09-07 02:14:21 -0700 | [diff] [blame] | 120 | if (Constants.SCHEME_MAILTO.equals(scheme)) { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 121 | mCreateExtras.putString(Intents.Insert.EMAIL, ssp); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 122 | |
Jeff Sharkey | 2409705 | 2009-08-24 15:27:31 -0700 | [diff] [blame] | 123 | Uri uri = Uri.withAppendedPath(Email.CONTENT_FILTER_EMAIL_URI, Uri.encode(ssp)); |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 124 | mQueryHandler.startQuery(QUERY_TOKEN, null, uri, CONTACTS_PROJECTION, null, null, null); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 125 | |
Jeff Sharkey | 49d17b3 | 2009-09-07 02:14:21 -0700 | [diff] [blame] | 126 | } else if (Constants.SCHEME_TEL.equals(scheme)) { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 127 | mCreateExtras.putString(Intents.Insert.PHONE, ssp); |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 128 | |
| 129 | Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, ssp); |
| 130 | mQueryHandler.startQuery(QUERY_TOKEN, null, uri, PHONES_PROJECTION, null, null, null); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 131 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 132 | } else { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 133 | // Otherwise assume incoming aggregate Uri |
Jeff Sharkey | 80a193a | 2009-05-21 14:18:18 -0700 | [diff] [blame] | 134 | showFastTrack(data); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 135 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 136 | } |
| 137 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 138 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 139 | @Override |
| 140 | protected void onStop() { |
| 141 | super.onStop(); |
| 142 | if (mQueryHandler != null) { |
| 143 | mQueryHandler.cancelOperation(QUERY_TOKEN); |
| 144 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 145 | if (mFastTrack != null) { |
| 146 | mFastTrack.dismiss(); |
| 147 | } |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 148 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 149 | |
| 150 | /** |
| 151 | * Show a {@link FastTrackWindow} for the given aggregate at the requested |
| 152 | * screen location. |
| 153 | */ |
Jeff Sharkey | 80a193a | 2009-05-21 14:18:18 -0700 | [diff] [blame] | 154 | private void showFastTrack(Uri aggUri) { |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 155 | // Use our local window token for now |
Jeff Sharkey | 802b205 | 2009-08-04 14:21:06 -0700 | [diff] [blame] | 156 | final Bundle extras = getIntent().getExtras(); |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 157 | |
| 158 | Rect targetRect; |
Jeff Sharkey | 802b205 | 2009-08-04 14:21:06 -0700 | [diff] [blame] | 159 | if (extras.containsKey(Intents.EXTRA_TARGET_RECT)) { |
| 160 | targetRect = (Rect)extras.getParcelable(Intents.EXTRA_TARGET_RECT); |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 161 | } else { |
| 162 | // TODO: this default rect matches gmail messages, and should move over there |
Jeff Sharkey | 73714ff | 2009-08-23 22:13:04 -0700 | [diff] [blame] | 163 | Log.w(TAG, "Using default TARGET_RECT"); |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 164 | targetRect = new Rect(15, 110, 15+18, 110+18); |
| 165 | } |
| 166 | |
Jeff Sharkey | 802b205 | 2009-08-04 14:21:06 -0700 | [diff] [blame] | 167 | // Use requested display mode, defaulting to medium |
| 168 | final int mode = extras.getInt(Intents.EXTRA_MODE, Intents.MODE_MEDIUM); |
Jeff Sharkey | 0b4ad00 | 2009-08-23 14:16:27 -0700 | [diff] [blame] | 169 | final String[] excludeMimes = extras.getStringArray(Intents.EXTRA_EXCLUDE_MIMES); |
Jeff Sharkey | 802b205 | 2009-08-04 14:21:06 -0700 | [diff] [blame] | 170 | |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 171 | mFastTrack = new FastTrackWindow(this, this); |
Jeff Sharkey | 0b4ad00 | 2009-08-23 14:16:27 -0700 | [diff] [blame] | 172 | mFastTrack.show(aggUri, targetRect, mode, excludeMimes); |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 173 | } |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 174 | |
Jeff Sharkey | 549aa16 | 2009-05-21 01:33:30 -0700 | [diff] [blame] | 175 | /** {@inheritDoc} */ |
| 176 | public void onDismiss(FastTrackWindow dialog) { |
| 177 | // When dismissed, finish this activity |
| 178 | finish(); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 181 | /** {@inheritDoc} */ |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 182 | public void onQueryComplete(int token, Object cookie, Cursor cursor) { |
| 183 | if (cursor == null) { |
Jeff Sharkey | 2409705 | 2009-08-24 15:27:31 -0700 | [diff] [blame] | 184 | // Bail when problem running query in background |
| 185 | finish(); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 186 | return; |
| 187 | } |
| 188 | |
| 189 | // Count contacts found by query |
| 190 | int count = 0; |
| 191 | long aggId = -1; |
| 192 | try { |
| 193 | count = cursor.getCount(); |
| 194 | if (count == 1 && cursor.moveToFirst()) { |
| 195 | // Try reading ID if only one contact returned |
| 196 | aggId = cursor.getLong(AGGREGATE_ID_INDEX); |
| 197 | } |
| 198 | } finally { |
| 199 | cursor.close(); |
| 200 | } |
| 201 | |
| 202 | if (count == 1 && aggId != -1) { |
Jeff Sharkey | 3926127 | 2009-06-03 19:15:09 -0700 | [diff] [blame] | 203 | // If we only found one item, show fast-track |
Dmitri Plotnikov | e1cd679 | 2009-07-27 20:28:17 -0700 | [diff] [blame] | 204 | final Uri aggUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, aggId); |
Jeff Sharkey | 80a193a | 2009-05-21 14:18:18 -0700 | [diff] [blame] | 205 | showFastTrack(aggUri); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 206 | |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 207 | } else if (count > 1) { |
| 208 | // If more than one, show pick list |
| 209 | Intent listIntent = new Intent(Intent.ACTION_SEARCH); |
| 210 | listIntent.setComponent(new ComponentName(this, ContactsListActivity.class)); |
| 211 | listIntent.putExtras(mCreateExtras); |
| 212 | startActivity(listIntent); |
| 213 | finish(); |
| 214 | |
| 215 | } else { |
| 216 | // No matching contacts found |
| 217 | if (mCreateForce) { |
| 218 | // Forced to create new contact |
Dmitri Plotnikov | 3946659 | 2009-07-27 11:23:51 -0700 | [diff] [blame] | 219 | Intent createIntent = new Intent(Intent.ACTION_INSERT, RawContacts.CONTENT_URI); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 220 | createIntent.putExtras(mCreateExtras); |
Dmitri Plotnikov | 3946659 | 2009-07-27 11:23:51 -0700 | [diff] [blame] | 221 | createIntent.setType(RawContacts.CONTENT_TYPE); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 222 | |
| 223 | startActivity(createIntent); |
| 224 | finish(); |
| 225 | |
| 226 | } else { |
| 227 | // Prompt user to insert or edit contact |
| 228 | Intent createIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT); |
| 229 | createIntent.putExtras(mCreateExtras); |
Dmitri Plotnikov | 3946659 | 2009-07-27 11:23:51 -0700 | [diff] [blame] | 230 | createIntent.setType(RawContacts.CONTENT_ITEM_TYPE); |
Jeff Sharkey | 3f17759 | 2009-05-18 15:23:12 -0700 | [diff] [blame] | 231 | |
| 232 | CharSequence message = getResources().getString( |
| 233 | R.string.add_contact_dlg_message_fmt, mCreateDescrip); |
| 234 | |
| 235 | new AlertDialog.Builder(this) |
| 236 | .setTitle(R.string.add_contact_dlg_title) |
| 237 | .setMessage(message) |
| 238 | .setPositiveButton(android.R.string.ok, |
| 239 | new IntentClickListener(this, createIntent)) |
| 240 | .setNegativeButton(android.R.string.cancel, |
| 241 | new IntentClickListener(this, null)) |
| 242 | .show(); |
| 243 | } |
| 244 | } |
| 245 | } |
| 246 | |
Jeff Sharkey | 3f0b7b8 | 2009-08-12 11:28:53 -0700 | [diff] [blame] | 247 | /** {@inheritDoc} */ |
| 248 | public void onQueryEntitiesComplete(int token, Object cookie, EntityIterator iterator) { |
| 249 | // No actions |
| 250 | } |
| 251 | |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 252 | /** |
| 253 | * Listener for {@link DialogInterface} that launches a given {@link Intent} |
| 254 | * when clicked. When clicked, this also closes the parent using |
| 255 | * {@link Activity#finish()}. |
| 256 | */ |
| 257 | private static class IntentClickListener implements DialogInterface.OnClickListener { |
| 258 | private Activity mParent; |
| 259 | private Intent mIntent; |
| 260 | |
| 261 | /** |
| 262 | * @param parent {@link Activity} to use for launching target. |
| 263 | * @param intent Target {@link Intent} to launch when clicked. |
| 264 | */ |
| 265 | public IntentClickListener(Activity parent, Intent intent) { |
| 266 | mParent = parent; |
| 267 | mIntent = intent; |
| 268 | } |
| 269 | |
| 270 | public void onClick(DialogInterface dialog, int which) { |
| 271 | if (mIntent != null) { |
| 272 | mParent.startActivity(mIntent); |
| 273 | } |
| 274 | mParent.finish(); |
| 275 | } |
| 276 | } |
The Android Open Source Project | 37a16ac | 2009-03-18 17:39:48 -0700 | [diff] [blame] | 277 | } |