本文整理汇总了Java中android.os.Bundle.getStringArrayList方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getStringArrayList方法的具体用法?Java Bundle.getStringArrayList怎么用?Java Bundle.getStringArrayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.getStringArrayList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onStartCommand
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Function to start service
*
* @param intent Activity intent
* @param flags to start sticky or not
* @param startId Service id
* @return usually start or start once
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.i("TAFSEER_DOWN_TAG" , "tafseer service is start");
AppPreference.Downloading(true);
Bundle extras = intent.getExtras();
String downloadURL = extras.getString(AppConstants.Download.DOWNLOAD_URL);
String downloadLocation = extras.getString(AppConstants.Download.DOWNLOAD_LOCATION);
int type = extras.getInt(AppConstants.Download.TYPE , -1);
List<String> downloadLinks = extras.getStringArrayList(AppConstants.Download.DOWNLOAD_LINKS);
if(downloadLinks == null){
downloadManager = new DownloadManager(this, true ,type);
downloadManager.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, downloadURL, downloadLocation);
} else{
downloadManager = new DownloadManager(this, true, downloadLinks ,type);
downloadManager.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, "", downloadLocation);
}
return START_NOT_STICKY;
}
示例2: onResults
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onResults(Bundle results) {
ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
int number = 0;
for (String result : matches) {
try {
number = Integer.parseInt(result);
break;
} catch (NumberFormatException e) {
e.printStackTrace();
number = 0;
}
}
editText.setText(number + "");
isActivated = false;
}
示例3: createAccessTokenFromNativeLogin
import android.os.Bundle; //导入方法依赖的package包/类
static AccessToken createAccessTokenFromNativeLogin(
Bundle bundle,
AccessTokenSource source,
String applicationId) {
Date expires = Utility.getBundleLongAsDate(
bundle, NativeProtocol.EXTRA_EXPIRES_SECONDS_SINCE_EPOCH, new Date(0));
ArrayList<String> permissions = bundle.getStringArrayList(NativeProtocol.EXTRA_PERMISSIONS);
String token = bundle.getString(NativeProtocol.EXTRA_ACCESS_TOKEN);
if (Utility.isNullOrEmpty(token)) {
return null;
}
String userId = bundle.getString(NativeProtocol.EXTRA_USER_ID);
return new AccessToken(
token,
applicationId,
userId,
permissions,
null,
source,
expires,
new Date());
}
示例4: initViews
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void initViews() {
Bundle bundle = getIntent().getExtras();
currentPos = bundle.getInt("position");
imgList = bundle.getStringArrayList("imgList");
mPresenter = new WelfareDetailPresenterImpl(this);
mAdapter = new WelfareDetailPageAdapter(this, imgList, mPresenter);
mViewPager.setAdapter(mAdapter);
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
@Override
public void onPageSelected(int position) {
currentPos = position;
tvIndex.setText(currentPos+1+" / " +imgList.size());
}
});
registerActivityFinish();
}
示例5: onStartCommand
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Function to start service
*
* @param intent Activity intent
* @param flags to start sticky or not
* @param startId Service id
* @return usually start or start once
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
AppPreference.Downloading(true);
Bundle extras = intent.getExtras();
String downloadURL = extras.getString(AppConstants.Download.DOWNLOAD_URL);
String downloadLocation = extras.getString(AppConstants.Download.DOWNLOAD_LOCATION);
List<String> downloadLinks = extras.getStringArrayList(AppConstants.Download.DOWNLOAD_LINKS);
if(downloadLinks == null){
downloadManager = new DownloadManager(this, true);
downloadManager.execute(downloadURL, downloadLocation);
} else{
downloadManager = new DownloadManager(this, true , downloadLinks);
downloadManager.execute("", downloadLocation);
}
return START_NOT_STICKY;
}
示例6: putResults
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Add the recognition results to the existing {@link Bundle}
*
* @param results recognition results {@link Bundle}
*/
public void putResults(@NonNull final Bundle results) {
if (DEBUG) {
MyLog.i(CLS_NAME, "putResults");
}
final ArrayList<String> heardVoice = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
final float[] confidence = results.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
if (heardVoice != null) {
getBundle().putStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION, heardVoice);
} else {
if (DEBUG) {
MyLog.i(CLS_NAME, "putResults: speech empty");
}
getBundle().putStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION, new ArrayList<String>());
}
if (confidence != null) {
getBundle().putFloatArray(SpeechRecognizer.CONFIDENCE_SCORES, confidence);
} else {
if (DEBUG) {
MyLog.i(CLS_NAME, "putResults: confidence empty");
}
getBundle().putFloatArray(SpeechRecognizer.CONFIDENCE_SCORES, new float[0]);
}
}
示例7: receiveResults
import android.os.Bundle; //导入方法依赖的package包/类
private void receiveResults(Bundle results) {
if ((results != null)
&& results.containsKey(SpeechRecognizer.RESULTS_RECOGNITION)) {
List<String> res = results
.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if (mResultCallback != null)
mResultCallback.onResult(res);
}
}
示例8: getTokenCompleted
import android.os.Bundle; //导入方法依赖的package包/类
void getTokenCompleted(AuthorizationRequest request, Bundle result) {
getTokenClient = null;
notifyBackgroundProcessingStop();
if (result != null) {
ArrayList<String> currentPermissions = result.getStringArrayList(NativeProtocol.EXTRA_PERMISSIONS);
List<String> permissions = request.getPermissions();
if ((currentPermissions != null) &&
((permissions == null) || currentPermissions.containsAll(permissions))) {
// We got all the permissions we needed, so we can complete the auth now.
AccessToken token = AccessToken
.createFromNativeLogin(result, AccessTokenSource.FACEBOOK_APPLICATION_SERVICE);
Result outcome = Result.createTokenResult(pendingRequest, token);
completeAndValidate(outcome);
return;
}
// We didn't get all the permissions we wanted, so update the request with just the permissions
// we still need.
List<String> newPermissions = new ArrayList<String>();
for (String permission : permissions) {
if (!currentPermissions.contains(permission)) {
newPermissions.add(permission);
}
}
if (!newPermissions.isEmpty()) {
addLoggingExtra(EVENT_EXTRAS_NEW_PERMISSIONS, TextUtils.join(",", newPermissions));
}
request.setPermissions(newPermissions);
}
tryNextHandler();
}
示例9: createFromNativeLogin
import android.os.Bundle; //导入方法依赖的package包/类
static AccessToken createFromNativeLogin(Bundle bundle, AccessTokenSource source) {
Date expires = getBundleLongAsDate(
bundle, NativeProtocol.EXTRA_EXPIRES_SECONDS_SINCE_EPOCH, new Date(0));
ArrayList<String> permissions = bundle.getStringArrayList(NativeProtocol.EXTRA_PERMISSIONS);
String token = bundle.getString(NativeProtocol.EXTRA_ACCESS_TOKEN);
return createNew(permissions, token, expires, source);
}
示例10: restoreInstanceStateInner
import android.os.Bundle; //导入方法依赖的package包/类
private void restoreInstanceStateInner(Bundle savedInstanceState) {
L.d(ContributeActy.class, "restoreInstanceStateInner---------");
mFromFeedback = savedInstanceState.getBoolean(EXTRA_FROM_FEEDBACK, false);
ArrayList<String> value = savedInstanceState.getStringArrayList(EXTRA_LIST_DATA);
if (value != null && value.size() > 0) {
List<Uri> data = new ArrayList<Uri>();
for (String s : value) {
data.add(Uri.parse(s));
}
getAdapter().setDataSource(data);
}
String json = savedInstanceState.getString(EXTRA_SESSION);
if (json != null) session = Session.fromJsonWithAllFields(json, Session.class);
}
示例11: a
import android.os.Bundle; //导入方法依赖的package包/类
private StringBuffer a(StringBuffer stringBuffer, Bundle bundle) {
f.c(f.d, "fillShareToQQParams() --start");
ArrayList stringArrayList = bundle.getStringArrayList("imageUrl");
Object string = bundle.getString("appName");
int i = bundle.getInt("req_type", 1);
String string2 = bundle.getString("title");
String string3 = bundle.getString("summary");
bundle.putString("appId", this.mToken.getAppId());
bundle.putString("sdkp", "a");
bundle.putString("sdkv", Constants.SDK_VERSION);
bundle.putString("status_os", VERSION.RELEASE);
bundle.putString("status_machine", Build.MODEL);
String str = "...";
if (!Util.isEmpty(string2) && string2.length() > 40) {
bundle.putString("title", string2.substring(0, 40) + "...");
}
if (!Util.isEmpty(string3) && string3.length() > 80) {
bundle.putString("summary", string3.substring(0, 80) + "...");
}
if (!TextUtils.isEmpty(string)) {
bundle.putString("site", string);
}
if (stringArrayList != null) {
int size = stringArrayList.size();
String[] strArr = new String[size];
for (int i2 = 0; i2 < size; i2++) {
strArr[i2] = (String) stringArrayList.get(i2);
}
bundle.putStringArray("imageUrl", strArr);
}
bundle.putString("type", String.valueOf(i));
stringBuffer.append("&" + Util.encodeUrl(bundle).replaceAll("\\+", "%20"));
f.c(f.d, "fillShareToQQParams() --end");
return stringBuffer;
}
示例12: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
ArrayList<String> missingPerms = extras.getStringArrayList(MISSING_PERMISSIONS);
ActivityCompat.requestPermissions(this,missingPerms.toArray(new String[missingPerms.size()]),
PERMISSION_REQUEST_ID);
}
示例13: restoreSavedInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
private void restoreSavedInstanceState(Bundle savedInstanceState) {
DebugLog.logMethod();
if (savedInstanceState == null) {
DebugLog.logMessage("savedInstanceState null");
merchants = new ArrayList<>();
categories = new ArrayList<>();
return;
}
DebugLog.logMessage("restoring savedInstanceState");
coupons = savedInstanceState.getParcelableArrayList(Constants.BUNDLE_EXTRA_COUPONS);
listPosition = Math.max(0, savedInstanceState.getInt(Constants.BUNDLE_EXTRA_LIST_POSITION));
merchants = savedInstanceState.getStringArrayList(Constants.BUNDLE_EXTRA_MERCHANT_SUGGESTIONS);
categories = savedInstanceState.getStringArrayList(Constants.BUNDLE_EXTRA_CATEGORY_SUGGESTIONS);
}
示例14: initBundleData
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void initBundleData(Bundle bundle) {
images = bundle.getStringArrayList("images");
currentPosition = bundle.getInt("curr");
if (ListUtils.isEmpty(images)) {
ToastUtil.showToastShort("获取数据出错");
finish();
}
}
示例15: SelectorModeManager
import android.os.Bundle; //导入方法依赖的package包/类
public SelectorModeManager(Bundle savedState) {
if (savedState.containsKey(SELECTOR_MODE_ACTIVE)) {
setSelectorMode(Boolean.parseBoolean(savedState.getString(SELECTOR_MODE_ACTIVE)));
}
if (isSelectorModeActive() && savedState.containsKey(SELECTED_ITEMS_PATHS)) {
selected_items_paths = savedState.getStringArrayList(SELECTED_ITEMS_PATHS);
} else {
selected_items_paths = new ArrayList<>();
}
}