blob: 8661956f6dcaba735bd1d72dba1dd26dec7ee39b [file] [log] [blame]
Amith Yamasanid7993472010-08-18 13:59:28 -07001/*
2 * Copyright (C) 2010 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
17package com.android.settings;
18
Fabrice Di Meglio5bdf0422014-07-01 15:15:18 -070019import android.app.Activity;
Amith Yamasanid7993472010-08-18 13:59:28 -070020import android.app.Dialog;
21import android.app.DialogFragment;
Daisuke Miyakawab5647c52010-09-10 18:04:02 -070022import android.app.Fragment;
Amith Yamasanid7993472010-08-18 13:59:28 -070023import android.content.ContentResolver;
Amith Yamasani350938e2013-04-09 10:22:47 -070024import android.content.Context;
Hung-ying Tyan0ee51e02011-01-25 16:42:14 +080025import android.content.DialogInterface;
Amith Yamasanid7993472010-08-18 13:59:28 -070026import android.content.pm.PackageManager;
Fabrice Di Meglioc853a422014-04-18 19:40:40 -070027import android.database.DataSetObserver;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070028import android.graphics.drawable.Drawable;
Amith Yamasanid7993472010-08-18 13:59:28 -070029import android.os.Bundle;
Amith Yamasani9627a8e2012-09-23 12:54:14 -070030import android.preference.Preference;
Fabrice Di Meglio5bdf0422014-07-01 15:15:18 -070031import android.preference.PreferenceActivity;
Amith Yamasanid7993472010-08-18 13:59:28 -070032import android.preference.PreferenceFragment;
Fabrice Di Meglioc1457322014-04-04 19:07:50 -070033import android.preference.PreferenceGroupAdapter;
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070034import android.text.TextUtils;
Amith Yamasanid7993472010-08-18 13:59:28 -070035import android.util.Log;
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070036import android.view.Menu;
37import android.view.MenuInflater;
38import android.view.MenuItem;
Fabrice Di Megliof2a52262014-04-17 17:20:27 -070039import android.view.View;
Daisuke Miyakawa9c8bde52010-08-25 11:58:37 -070040import android.widget.Button;
Fabrice Di Meglioc1457322014-04-04 19:07:50 -070041import android.widget.ListAdapter;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070042import android.widget.ListView;
Amith Yamasanid7993472010-08-18 13:59:28 -070043
Daisuke Miyakawaf58090d2010-09-12 17:27:33 -070044/**
Amith Yamasanid7993472010-08-18 13:59:28 -070045 * Base class for Settings fragments, with some helper functions and dialog management.
46 */
Gilles Debunne64650542011-08-23 11:01:35 -070047public class SettingsPreferenceFragment extends PreferenceFragment implements DialogCreatable {
Amith Yamasanid7993472010-08-18 13:59:28 -070048
49 private static final String TAG = "SettingsPreferenceFragment";
50
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070051 private static final int MENU_HELP = Menu.FIRST + 100;
Fabrice Di Meglioc853a422014-04-18 19:40:40 -070052 private static final int DELAY_HIGHLIGHT_DURATION_MILLIS = 400;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070053
54 private static final String SAVE_HIGHLIGHTED_KEY = "android:preference_highlighted";
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070055
Amith Yamasanid7993472010-08-18 13:59:28 -070056 private SettingsDialogFragment mDialogFragment;
57
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070058 private String mHelpUrl;
59
Amith Yamasani350938e2013-04-09 10:22:47 -070060 // Cache the content resolver for async callbacks
61 private ContentResolver mContentResolver;
62
Fabrice Di Megliof2a52262014-04-17 17:20:27 -070063 private String mPreferenceKey;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070064 private boolean mPreferenceHighlighted = false;
Fabrice Di Meglio4a2ee7e2014-05-21 16:19:41 -070065 private Drawable mHighlightDrawable;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070066
Fabrice Di Meglio829c8fb2014-04-21 11:40:21 -070067 private boolean mIsDataSetObserverRegistered = false;
Fabrice Di Meglioc853a422014-04-18 19:40:40 -070068 private DataSetObserver mDataSetObserver = new DataSetObserver() {
69 @Override
70 public void onChanged() {
71 highlightPreferenceIfNeeded();
72 }
73
74 @Override
75 public void onInvalidated() {
76 highlightPreferenceIfNeeded();
77 }
78 };
79
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070080 @Override
81 public void onCreate(Bundle icicle) {
82 super.onCreate(icicle);
83
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070084 if (icicle != null) {
85 mPreferenceHighlighted = icicle.getBoolean(SAVE_HIGHLIGHTED_KEY);
86 }
87
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070088 // Prepare help url and enable menu if necessary
89 int helpResource = getHelpResource();
90 if (helpResource != 0) {
91 mHelpUrl = getResources().getString(helpResource);
Amith Yamasanib0b37ae2012-04-23 15:35:36 -070092 }
93 }
94
Daisuke Miyakawab5647c52010-09-10 18:04:02 -070095 @Override
Fabrice Di Meglio6602d022014-04-15 16:45:20 -070096 public void onSaveInstanceState(Bundle outState) {
97 super.onSaveInstanceState(outState);
98
99 outState.putBoolean(SAVE_HIGHLIGHTED_KEY, mPreferenceHighlighted);
100 }
101
102 @Override
Amith Yamasanid7993472010-08-18 13:59:28 -0700103 public void onActivityCreated(Bundle savedInstanceState) {
104 super.onActivityCreated(savedInstanceState);
Amith Yamasanib3a593e2012-04-23 18:03:52 -0700105 if (!TextUtils.isEmpty(mHelpUrl)) {
106 setHasOptionsMenu(true);
107 }
Fabrice Di Meglio4a2ee7e2014-05-21 16:19:41 -0700108 }
109
110 @Override
111 public void onResume() {
112 super.onResume();
Fabrice Di Meglioc1457322014-04-04 19:07:50 -0700113
114 final Bundle args = getArguments();
115 if (args != null) {
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700116 mPreferenceKey = args.getString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY);
117 highlightPreferenceIfNeeded();
Fabrice Di Meglioc1457322014-04-04 19:07:50 -0700118 }
119 }
120
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700121 @Override
122 protected void onBindPreferences() {
Fabrice Di Meglio405febf2014-04-24 10:13:59 -0700123 registerObserverIfNeeded();
124 }
125
126 @Override
127 public void onStop() {
128 super.onStop();
129
130 unregisterObserverIfNeeded();
131 }
132
133 public void registerObserverIfNeeded() {
Fabrice Di Meglio829c8fb2014-04-21 11:40:21 -0700134 if (!mIsDataSetObserverRegistered) {
135 getPreferenceScreen().getRootAdapter().registerDataSetObserver(mDataSetObserver);
136 mIsDataSetObserverRegistered = true;
137 }
Fabrice Di Meglioc853a422014-04-18 19:40:40 -0700138 }
139
Fabrice Di Meglio405febf2014-04-24 10:13:59 -0700140 public void unregisterObserverIfNeeded() {
Fabrice Di Meglio829c8fb2014-04-21 11:40:21 -0700141 if (mIsDataSetObserverRegistered) {
142 getPreferenceScreen().getRootAdapter().unregisterDataSetObserver(mDataSetObserver);
143 mIsDataSetObserverRegistered = false;
144 }
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700145 }
Fabrice Di Meglio6602d022014-04-15 16:45:20 -0700146
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700147 public void highlightPreferenceIfNeeded() {
Fabrice Di Meglioc853a422014-04-18 19:40:40 -0700148 if (isAdded() && !mPreferenceHighlighted &&!TextUtils.isEmpty(mPreferenceKey)) {
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700149 highlightPreference(mPreferenceKey);
Fabrice Di Meglio6602d022014-04-15 16:45:20 -0700150 }
Fabrice Di Meglio6602d022014-04-15 16:45:20 -0700151 }
152
153 private Drawable getHighlightDrawable() {
Fabrice Di Meglio4a2ee7e2014-05-21 16:19:41 -0700154 if (mHighlightDrawable == null) {
155 mHighlightDrawable = getActivity().getDrawable(R.drawable.preference_highlight);
156 }
157 return mHighlightDrawable;
Fabrice Di Meglio6602d022014-04-15 16:45:20 -0700158 }
159
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700160 /**
161 * Return a valid ListView position or -1 if none is found
162 */
163 private int canUseListViewForHighLighting(String key) {
164 if (!hasListView()) {
165 return -1;
166 }
167
168 ListView listView = getListView();
169 ListAdapter adapter = listView.getAdapter();
170
171 if (adapter != null && adapter instanceof PreferenceGroupAdapter) {
172 return findListPositionFromKey(adapter, key);
173 }
174
175 return -1;
176 }
177
178 private void highlightPreference(String key) {
179 final Drawable highlight = getHighlightDrawable();
180
181 final int position = canUseListViewForHighLighting(key);
182 if (position >= 0) {
Fabrice Di Meglio4a2ee7e2014-05-21 16:19:41 -0700183 mPreferenceHighlighted = true;
184
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700185 final ListView listView = getListView();
186 final ListAdapter adapter = listView.getAdapter();
187
188 ((PreferenceGroupAdapter) adapter).setHighlightedDrawable(highlight);
189 ((PreferenceGroupAdapter) adapter).setHighlighted(position);
190
191 listView.post(new Runnable() {
192 @Override
193 public void run() {
194 listView.setSelection(position);
195 listView.postDelayed(new Runnable() {
196 @Override
197 public void run() {
Alan Viveretteba348ca2014-05-19 15:10:36 -0700198 final View v = listView.getChildAt(0);
199 final int centerX = v.getWidth() / 2;
200 final int centerY = v.getHeight() / 2;
201 highlight.setHotspot(centerX, centerY);
202 v.setPressed(true);
203 v.setPressed(false);
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700204 }
205 }, DELAY_HIGHLIGHT_DURATION_MILLIS);
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700206 }
207 });
Fabrice Di Megliof2a52262014-04-17 17:20:27 -0700208 }
209 }
210
211 private int findListPositionFromKey(ListAdapter adapter, String key) {
212 final int count = adapter.getCount();
213 for (int n = 0; n < count; n++) {
214 final Object item = adapter.getItem(n);
215 if (item instanceof Preference) {
216 Preference preference = (Preference) item;
217 final String preferenceKey = preference.getKey();
218 if (preferenceKey != null && preferenceKey.equals(key)) {
219 return n;
Fabrice Di Meglioc1457322014-04-04 19:07:50 -0700220 }
Fabrice Di Meglioc1457322014-04-04 19:07:50 -0700221 }
222 }
223 return -1;
Amith Yamasanid7993472010-08-18 13:59:28 -0700224 }
225
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700226 protected void removePreference(String key) {
227 Preference pref = findPreference(key);
228 if (pref != null) {
229 getPreferenceScreen().removePreference(pref);
230 }
231 }
232
Amith Yamasanib0b37ae2012-04-23 15:35:36 -0700233 /**
234 * Override this if you want to show a help item in the menu, by returning the resource id.
235 * @return the resource id for the help url
236 */
237 protected int getHelpResource() {
238 return 0;
239 }
240
241 @Override
242 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
Amith Yamasaniaeb57ed2012-12-06 14:40:51 -0800243 if (mHelpUrl != null && getActivity() != null) {
Amith Yamasanib0b37ae2012-04-23 15:35:36 -0700244 MenuItem helpItem = menu.add(0, MENU_HELP, 0, R.string.help_label);
Amith Yamasaniaeb57ed2012-12-06 14:40:51 -0800245 HelpUtils.prepareHelpMenuItem(getActivity(), helpItem, mHelpUrl);
Amith Yamasanib0b37ae2012-04-23 15:35:36 -0700246 }
247 }
248
Daisuke Miyakawab5647c52010-09-10 18:04:02 -0700249 /*
250 * The name is intentionally made different from Activity#finish(), so that
251 * users won't misunderstand its meaning.
252 */
253 public final void finishFragment() {
254 getActivity().onBackPressed();
255 }
256
Amith Yamasanid7993472010-08-18 13:59:28 -0700257 // Some helpers for functions used by the settings fragments when they were activities
258
259 /**
260 * Returns the ContentResolver from the owning Activity.
261 */
262 protected ContentResolver getContentResolver() {
Amith Yamasani350938e2013-04-09 10:22:47 -0700263 Context context = getActivity();
264 if (context != null) {
265 mContentResolver = context.getContentResolver();
266 }
267 return mContentResolver;
Amith Yamasanid7993472010-08-18 13:59:28 -0700268 }
269
270 /**
271 * Returns the specified system service from the owning Activity.
272 */
273 protected Object getSystemService(final String name) {
274 return getActivity().getSystemService(name);
275 }
276
277 /**
Amith Yamasanid7993472010-08-18 13:59:28 -0700278 * Returns the PackageManager from the owning Activity.
279 */
280 protected PackageManager getPackageManager() {
281 return getActivity().getPackageManager();
282 }
283
Dianne Hackborn0385cf12011-01-24 16:22:13 -0800284 @Override
285 public void onDetach() {
286 if (isRemoving()) {
287 if (mDialogFragment != null) {
288 mDialogFragment.dismiss();
289 mDialogFragment = null;
290 }
291 }
292 super.onDetach();
293 }
294
Amith Yamasanid7993472010-08-18 13:59:28 -0700295 // Dialog management
296
297 protected void showDialog(int dialogId) {
298 if (mDialogFragment != null) {
299 Log.e(TAG, "Old dialog fragment not null!");
300 }
301 mDialogFragment = new SettingsDialogFragment(this, dialogId);
Fabrice Di Meglio377dd622014-02-12 20:05:57 -0800302 mDialogFragment.show(getChildFragmentManager(), Integer.toString(dialogId));
Amith Yamasanid7993472010-08-18 13:59:28 -0700303 }
304
305 public Dialog onCreateDialog(int dialogId) {
306 return null;
307 }
308
309 protected void removeDialog(int dialogId) {
Hung-ying Tyanadc83d82011-01-24 15:05:27 +0800310 // mDialogFragment may not be visible yet in parent fragment's onResume().
311 // To be able to dismiss dialog at that time, don't check
312 // mDialogFragment.isVisible().
313 if (mDialogFragment != null && mDialogFragment.getDialogId() == dialogId) {
Amith Yamasanid7993472010-08-18 13:59:28 -0700314 mDialogFragment.dismiss();
315 }
316 mDialogFragment = null;
317 }
318
Hung-ying Tyan0ee51e02011-01-25 16:42:14 +0800319 /**
320 * Sets the OnCancelListener of the dialog shown. This method can only be
321 * called after showDialog(int) and before removeDialog(int). The method
322 * does nothing otherwise.
323 */
324 protected void setOnCancelListener(DialogInterface.OnCancelListener listener) {
325 if (mDialogFragment != null) {
326 mDialogFragment.mOnCancelListener = listener;
327 }
328 }
329
330 /**
331 * Sets the OnDismissListener of the dialog shown. This method can only be
332 * called after showDialog(int) and before removeDialog(int). The method
333 * does nothing otherwise.
334 */
335 protected void setOnDismissListener(DialogInterface.OnDismissListener listener) {
336 if (mDialogFragment != null) {
337 mDialogFragment.mOnDismissListener = listener;
338 }
339 }
340
Amith Yamasanic861cf82012-10-02 14:51:46 -0700341 public void onDialogShowing() {
342 // override in subclass to attach a dismiss listener, for instance
343 }
344
Amith Yamasani43c69782010-12-01 09:04:36 -0800345 public static class SettingsDialogFragment extends DialogFragment {
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800346 private static final String KEY_DIALOG_ID = "key_dialog_id";
347 private static final String KEY_PARENT_FRAGMENT_ID = "key_parent_fragment_id";
348
Amith Yamasanid7993472010-08-18 13:59:28 -0700349 private int mDialogId;
350
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800351 private Fragment mParentFragment;
352
Hung-ying Tyan0ee51e02011-01-25 16:42:14 +0800353 private DialogInterface.OnCancelListener mOnCancelListener;
354 private DialogInterface.OnDismissListener mOnDismissListener;
355
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800356 public SettingsDialogFragment() {
357 /* do nothing */
358 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700359
Amith Yamasani43c69782010-12-01 09:04:36 -0800360 public SettingsDialogFragment(DialogCreatable fragment, int dialogId) {
Amith Yamasanid7993472010-08-18 13:59:28 -0700361 mDialogId = dialogId;
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800362 if (!(fragment instanceof Fragment)) {
363 throw new IllegalArgumentException("fragment argument must be an instance of "
364 + Fragment.class.getName());
365 }
366 mParentFragment = (Fragment) fragment;
367 }
368
369 @Override
Dianne Hackborn300768f2011-01-27 20:39:21 -0800370 public void onSaveInstanceState(Bundle outState) {
371 super.onSaveInstanceState(outState);
372 if (mParentFragment != null) {
373 outState.putInt(KEY_DIALOG_ID, mDialogId);
374 outState.putInt(KEY_PARENT_FRAGMENT_ID, mParentFragment.getId());
375 }
376 }
377
378 @Override
Amith Yamasanic861cf82012-10-02 14:51:46 -0700379 public void onStart() {
380 super.onStart();
381
382 if (mParentFragment != null && mParentFragment instanceof SettingsPreferenceFragment) {
383 ((SettingsPreferenceFragment) mParentFragment).onDialogShowing();
384 }
385 }
386
387 @Override
Dianne Hackborn300768f2011-01-27 20:39:21 -0800388 public Dialog onCreateDialog(Bundle savedInstanceState) {
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800389 if (savedInstanceState != null) {
390 mDialogId = savedInstanceState.getInt(KEY_DIALOG_ID, 0);
Fabrice Di Meglio377dd622014-02-12 20:05:57 -0800391 mParentFragment = getParentFragment();
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800392 int mParentFragmentId = savedInstanceState.getInt(KEY_PARENT_FRAGMENT_ID, -1);
Fabrice Di Meglio377dd622014-02-12 20:05:57 -0800393 if (!(mParentFragment instanceof DialogCreatable)) {
394 throw new IllegalArgumentException(
395 (mParentFragment != null
396 ? mParentFragment.getClass().getName()
397 : mParentFragmentId)
398 + " must implement "
399 + DialogCreatable.class.getName());
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800400 }
Amith Yamasani8875ede2011-01-31 12:46:57 -0800401 // This dialog fragment could be created from non-SettingsPreferenceFragment
402 if (mParentFragment instanceof SettingsPreferenceFragment) {
403 // restore mDialogFragment in mParentFragment
404 ((SettingsPreferenceFragment) mParentFragment).mDialogFragment = this;
405 }
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800406 }
Svetoslav Ganov749ba652010-12-09 14:53:02 -0800407 return ((DialogCreatable) mParentFragment).onCreateDialog(mDialogId);
Amith Yamasanid7993472010-08-18 13:59:28 -0700408 }
409
Hung-ying Tyan0ee51e02011-01-25 16:42:14 +0800410 @Override
411 public void onCancel(DialogInterface dialog) {
412 super.onCancel(dialog);
413 if (mOnCancelListener != null) {
414 mOnCancelListener.onCancel(dialog);
415 }
416 }
417
418 @Override
419 public void onDismiss(DialogInterface dialog) {
420 super.onDismiss(dialog);
421 if (mOnDismissListener != null) {
422 mOnDismissListener.onDismiss(dialog);
423 }
424 }
Amith Yamasani8875ede2011-01-31 12:46:57 -0800425
Amith Yamasanid7993472010-08-18 13:59:28 -0700426 public int getDialogId() {
427 return mDialogId;
428 }
Hung-ying Tyan18eb39d2011-01-28 16:17:27 +0800429
430 @Override
431 public void onDetach() {
432 super.onDetach();
433
Amith Yamasani8875ede2011-01-31 12:46:57 -0800434 // This dialog fragment could be created from non-SettingsPreferenceFragment
435 if (mParentFragment instanceof SettingsPreferenceFragment) {
436 // in case the dialog is not explicitly removed by removeDialog()
437 if (((SettingsPreferenceFragment) mParentFragment).mDialogFragment == this) {
438 ((SettingsPreferenceFragment) mParentFragment).mDialogFragment = null;
439 }
Hung-ying Tyan18eb39d2011-01-28 16:17:27 +0800440 }
441 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700442 }
Daisuke Miyakawa9c8bde52010-08-25 11:58:37 -0700443
444 protected boolean hasNextButton() {
Daisuke Miyakawa79c5fd92011-01-15 14:58:00 -0800445 return ((ButtonBarHandler)getActivity()).hasNextButton();
Daisuke Miyakawa9c8bde52010-08-25 11:58:37 -0700446 }
447
448 protected Button getNextButton() {
Daisuke Miyakawa79c5fd92011-01-15 14:58:00 -0800449 return ((ButtonBarHandler)getActivity()).getNextButton();
Daisuke Miyakawa9c8bde52010-08-25 11:58:37 -0700450 }
451
Daisuke Miyakawa6ebf8612010-09-10 09:48:51 -0700452 public void finish() {
453 getActivity().onBackPressed();
454 }
455
Fabrice Di Meglio5bdf0422014-07-01 15:15:18 -0700456 public boolean startFragment(Fragment caller, String fragmentClass, int titleRes,
457 int requestCode, Bundle extras) {
458 final Activity activity = getActivity();
459 if (activity instanceof SettingsActivity) {
460 SettingsActivity sa = (SettingsActivity) activity;
461 sa.startPreferencePanel(fragmentClass, extras, titleRes, null, caller, requestCode);
462 return true;
463 } else if (activity instanceof PreferenceActivity) {
464 PreferenceActivity sa = (PreferenceActivity) activity;
465 sa.startPreferencePanel(fragmentClass, extras, titleRes, null, caller, requestCode);
Daisuke Miyakawa25af1502010-09-24 11:29:31 -0700466 return true;
Daisuke Miyakawab5647c52010-09-10 18:04:02 -0700467 } else {
Fabrice Di Meglio5bdf0422014-07-01 15:15:18 -0700468 Log.w(TAG,
469 "Parent isn't SettingsActivity nor PreferenceActivity, thus there's no way to "
470 + "launch the given Fragment (name: " + fragmentClass
471 + ", requestCode: " + requestCode + ")");
Daisuke Miyakawab5647c52010-09-10 18:04:02 -0700472 return false;
473 }
474 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700475}