File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2121import android .content .Intent ;
2222import android .content .pm .ResolveInfo ;
2323import android .database .DataSetObservable ;
24- import android .database .DataSetObserver ;
2524import android .os .AsyncTask ;
2625import android .text .TextUtils ;
2726import android .util .Log ;
@@ -458,13 +457,18 @@ public int getActivityIndex(ResolveInfo activity) {
458457 * </p>
459458 *
460459 * @return An {@link Intent} for launching the activity or null if the
461- * policy has consumed the intent.
460+ * policy has consumed the intent or there is not current intent
461+ * set via {@link #setIntent(Intent)}.
462462 *
463463 * @see HistoricalRecord
464464 * @see OnChooseActivityListener
465465 */
466466 public Intent chooseActivity (int index ) {
467467 synchronized (mInstanceLock ) {
468+ if (mIntent == null ) {
469+ return null ;
470+ }
471+
468472 ensureConsistentState ();
469473
470474 ActivityResolveInfo chosenActivity = mActivities .get (index );
You can’t perform that action at this time.
0 commit comments