コード例 #1
0
 /**
  * Get the remote input results bundle from an intent. The returned Bundle will contain a
  * key/value for every result key populated by remote input collector. Use the {@link
  * Bundle#getCharSequence(String)} method to retrieve a value.
  *
  * @param intent The intent object that fired in response to an action or content intent which
  *     also had one or more remote input requested.
  */
 public static Bundle getResultsFromIntent(Intent intent) {
   ClipData clipData = intent.getClipData();
   if (clipData == null) {
     return null;
   }
   ClipDescription clipDescription = clipData.getDescription();
   if (!clipDescription.hasMimeType(ClipDescription.MIMETYPE_TEXT_INTENT)) {
     return null;
   }
   if (clipDescription.getLabel().equals(RESULTS_CLIP_LABEL)) {
     return clipData.getItemAt(0).getIntent().getExtras().getParcelable(EXTRA_RESULTS_DATA);
   }
   return null;
 }
コード例 #2
0
ファイル: w.java プロジェクト: Gruop5/com.tencent.mm
 public final Bundle getResultsFromIntent(Intent paramIntent) {
   paramIntent = paramIntent.getClipData();
   if (paramIntent != null) {
     ClipDescription localClipDescription = paramIntent.getDescription();
     if ((localClipDescription.hasMimeType("text/vnd.android.intent"))
         && (localClipDescription.getLabel().equals("android.remoteinput.results"))) {
       return (Bundle)
           paramIntent
               .getItemAt(0)
               .getIntent()
               .getExtras()
               .getParcelable("android.remoteinput.resultsData");
     }
   }
   return null;
 }