当前位置: 首页>>代码示例>>Java>>正文


Java Intent.getStringArrayListExtra方法代码示例

本文整理汇总了Java中android.content.Intent.getStringArrayListExtra方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.getStringArrayListExtra方法的具体用法?Java Intent.getStringArrayListExtra怎么用?Java Intent.getStringArrayListExtra使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.getStringArrayListExtra方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMapReady

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * This is where we can add markers or lines, add listeners or move the camera. In this case,
 * we just add a marker near Sydney, Australia.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    googleMap.clear();
    GoToMap = googleMap;
    Intent i = getIntent();
    ArrayList<LatLng> list1 = i.getParcelableArrayListExtra("key1");
    ArrayList<String> list2 = i.getStringArrayListExtra("key2");
    ArrayList<String> list3 = i.getStringArrayListExtra("key3");

    LatLng latLng = new LatLng(0, 0);
    int j = list1.size();
    j=j-1;
    while (j!=-1)
    {
        if(list1.get(j)!=latLng)
        {   Log.i(list1.get(j).toString(),list1.get(j).toString());
            GoToMap.addMarker(new MarkerOptions().position(list1.get(j)).draggable(true).title(list3.get(j).replace(',','.')+" Battery Power "+list2.get(j)));
            GoToMap.moveCamera(CameraUpdateFactory.newLatLng(list1.get(j)));
        }
        j--;
    }
    // Add a marker in Sydney and move the camera
}
 
开发者ID:ayushghd,项目名称:iSPY,代码行数:33,代码来源:MapsActivity.java

示例2: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK &&
            (requestCode == PhotoPicker.REQUEST_CODE || requestCode == PhotoPreview.REQUEST_CODE)) {

        ArrayList<String> photos = null;
        if (data != null) {
            photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
        }

        if (photos != null) {
            mLayout.setSelectedImages(photos);
        }
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:17,代码来源:BnPublishActivity.java

示例3: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (data != null) {
        switch (requestCode) {
            case 1:
                List<String> path = data.getStringArrayListExtra(MultiImageSelectorActivity
                        .EXTRA_RESULT);
                if (path != null && path.size() > 0) {
                    this.imgPath = (String) path.get(0);
                    ImageLoader.getInstance().displayImage(Uri.decode(Uri.fromFile(new File
                            (this.imgPath)).toString()), this.ivFoodImg, ImageLoaderOptions
                            .color(R.color.ju));
                    this.rlFoodImg.setVisibility(0);
                    break;
                }
        }
        super.onActivityResult(requestCode, resultCode, data);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:AddCustomFoodActivity.java

示例4: initData

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void initData() {
    Intent intent = getIntent();
    if (intent == null) {
        finish();
        return;
    }
    photos = intent.getStringArrayListExtra("photos");
    if (photos == null) {
        finish();
        return;
    }
    currentPos = intent.getIntExtra("pos", 0);
    adapter = new GalleryAdapter();
    viewPager.setAdapter(adapter);
    viewPager.setCurrentItem(currentPos);
}
 
开发者ID:YMlion,项目名称:leisure-glance,代码行数:18,代码来源:GalleryActivity.java

示例5: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode) {
        case 2:
            if (resultCode == -1) {
                List<String> pathList = data.getStringArrayListExtra
                        (MultiImageSelectorActivity.EXTRA_RESULT);
                if (pathList != null && pathList.size() > 0) {
                    if (!TextUtil.isEmpty((String) pathList.get(0))) {
                        uploadPicture((String) pathList.get(0));
                        return;
                    }
                    return;
                }
                return;
            }
            return;
        default:
            return;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:BecomeTeamLeaderActivity.java

示例6: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Receiving speech input
 * */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    switch (requestCode) {
        case REQ_CODE_SPEECH_INPUT: {
            if (resultCode == RESULT_OK && null != data) {

                ArrayList<String> result = data
                        .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
                txtSpeechInput.setText(result.get(0));
            }
            break;
        }

    }
}
 
开发者ID:Captwalloper,项目名称:NUI_Project,代码行数:21,代码来源:VoiceActivity.java

示例7: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode) {
        case RESULT_SPEECH: {
            if (resultCode == RESULT_OK && null != data) {

                ArrayList<String> text = data
                        .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

                autoCompleteTextView.setText(text.get(0));
            }
            break;
        }

    }
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:18,代码来源:SearchActivity.java

示例8: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int reqCode, int resultCode, final Intent data) {
  super.onActivityResult(reqCode, resultCode, data);
  Uri outputFile = Uri.fromFile(new File(getCacheDir(), "cropped"));

  if (data == null || resultCode != Activity.RESULT_OK)
    return;

  switch (reqCode) {
    case PICK_CONTACT:
      List<String> selected = data.getStringArrayListExtra("contacts");
      for (String contact : selected) {
        final Recipient recipient = RecipientFactory.getRecipientsFromString(this, contact, false).getPrimaryRecipient();
        if (recipient != null) addSelectedContacts(recipient);
      }
      break;

    case Crop.REQUEST_PICK:
      new Crop(data.getData()).output(outputFile).asSquare().start(this);
      break;
    case Crop.REQUEST_CROP:
      Glide.with(this).load(Crop.getOutput(data)).asBitmap()
           .skipMemoryCache(true)
           .diskCacheStrategy(DiskCacheStrategy.NONE)
           .centerCrop().override(AVATAR_SIZE, AVATAR_SIZE)
           .into(new SimpleTarget<Bitmap>() {
             @Override
             public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
               setAvatar(Crop.getOutput(data), resource);
             }
           });
  }
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:34,代码来源:GroupCreateActivity.java

示例9: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS) {
        if (PermissionCheckUtil.checkPermissions(this, AUDIO_CALL_PERMISSIONS)) {
            if (startForCheckPermissions) {
                startForCheckPermissions = false;
                RongCallClient.getInstance().onPermissionGranted();
            } else {
                initView();
            }
        } else {
            if (startForCheckPermissions) {
                startForCheckPermissions = false;
                RongCallClient.getInstance().onPermissionDenied();
            } else {
                finish();
            }
        }

    } else {
        if (callSession.getEndTime() != 0) {
            finish();
            return;
        }
        shouldShowFloat = true;
        if (resultCode == RESULT_OK) {
            ArrayList<String> invited = data.getStringArrayListExtra("invited");
            RongCallClient.getInstance().addParticipants(callSession.getCallId(), invited);
        }
    }
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:33,代码来源:MultiAudioCallActivity.java

示例10: markMessagesAsRead

import android.content.Intent; //导入方法依赖的package包/类
private void markMessagesAsRead(Intent intent, Account account, MessagingController controller) {
    Timber.i("NotificationActionService marking messages as read");

    List<String> messageReferenceStrings = intent.getStringArrayListExtra(EXTRA_MESSAGE_REFERENCES);
    List<MessageReference> messageReferences = toMessageReferenceList(messageReferenceStrings);
    for (MessageReference messageReference : messageReferences) {
        String folderName = messageReference.getFolderId();
        String uid = messageReference.getUid();
        controller.setFlag(account, folderName, uid, Flag.SEEN, true);
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:12,代码来源:NotificationActionService.java

示例11: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == com.veer.multiselect.Util.Constants.REQUEST_CODE_MULTISELECT
      && resultCode == RESULT_OK) {
    paths = data.getStringArrayListExtra(com.veer.multiselect.Util.Constants.GET_PATHS);
    rcItems.getAdapter().notifyDataSetChanged();
  }
}
 
开发者ID:karanvs,项目名称:multiselect,代码行数:9,代码来源:MainActivity.java

示例12: getStringArrayListExtra

import android.content.Intent; //导入方法依赖的package包/类
public static ArrayList<String> getStringArrayListExtra(Intent intent, String name) {
    if (intent == null) {
        return null;
    }
    try {
        return intent.getStringArrayListExtra(name);
    } catch (Exception e) {
        Log.e(TAG, "getStringExtra exception:" + e.getMessage());
        return null;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:ShareIntentUtil.java

示例13: init

import android.content.Intent; //导入方法依赖的package包/类
private void init() {

		llTopMenuWindowBg = findViewById(R.id.llTopMenuWindowBg);
		llTopMenuWindowBg.setOnClickListener(this);

		Intent intent = getIntent();

		int[] intentCodes = intent.getIntArrayExtra(INTENT_INTENTCODES);
		if (intentCodes == null || intentCodes.length <= 0) {
			intentCodeList = intent.getIntegerArrayListExtra(INTENT_INTENTCODES);
		} else {
			intentCodeList = new ArrayList<Integer>();
			for (int code : intentCodes) {
				intentCodeList.add(code);
			}
		}

		String[] menuItems = intent.getStringArrayExtra(INTENT_NAMES);
		if (menuItems == null || menuItems.length <= 0) {
			nameList = intent.getStringArrayListExtra(INTENT_NAMES);
		} else {
			nameList = new ArrayList<String>(Arrays.asList(menuItems));
		}

		if (nameList == null || nameList.size() <= 0) {
			Log.e(TAG, "init   nameList == null || nameList.size() <= 0 >> finish();return;");
			finish();
			return;
		}

		adapter = new ArrayAdapter<String>(this, R.layout.top_menu_list_item, R.id.tvTopMenuListItem, nameList);

		lvTopMenu = (ListView) findViewById(R.id.lvTopMenuWindowMenu);
		lvTopMenu.setAdapter(adapter);
		lvTopMenu.setOnItemClickListener(this);
	}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:TopMenuWindow.java

示例14: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode != RESULT_OK) {
        return;
    }

    if (data == null) {
        return;
    }
    ArrayList<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
    if (photos == null) {
        return;
    }

    for (String photo : photos) {
        File file = new File(photo);
        if (file != null && file.exists() == true && file.isFile() == true) {
            File destFile = new File(Constant.getStickerDirectory(), file.getName());

            try {
                Util.copy(file, destFile);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:monthlypub,项目名称:SmingZZick_App,代码行数:30,代码来源:StickerAttacherActivity.java

示例15: getResult

import android.content.Intent; //导入方法依赖的package包/类
public VoiceResult getResult(int resultCode, Intent data) {
    if (hasFailureMessage()) {
        String message = popErrorMessage();
        return new VoiceResult(false, message);
    }
    else if (resultCode == RESULT_OK && null != data) {
        ArrayList<String> result = data
                .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        String value = result.get(0);
        return new VoiceResult(true, value);
    }
    else {
        throw new RuntimeException("VoiceListener failed to return an expected result.");
    }
}
 
开发者ID:Captwalloper,项目名称:NUI_Project,代码行数:16,代码来源:VoiceListener.java


注:本文中的android.content.Intent.getStringArrayListExtra方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。