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


Java Bundle.getIntegerArrayList方法代码示例

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


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

示例1: onCreateView

import android.os.Bundle; //导入方法依赖的package包/类
@Override
@CallSuper
public View onCreateView(LayoutInflater inflater,
		@Nullable ViewGroup container,
		@Nullable Bundle savedInstanceState) {

	View contentView = inflater.inflate(R.layout.list, container, false);

	list = (BriarRecyclerView) contentView.findViewById(R.id.list);
	list.setLayoutManager(new LinearLayoutManager(getActivity()));
	list.setEmptyText(getString(R.string.no_contacts_selector));
	adapter = getAdapter(getContext(), this);
	list.setAdapter(adapter);

	// restore selected contacts if available
	if (savedInstanceState != null) {
		ArrayList<Integer> intContacts =
				savedInstanceState.getIntegerArrayList(CONTACTS);
		if (intContacts != null) {
			selectedContacts = getContactsFromIntegers(intContacts);
		}
	}
	return contentView;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:25,代码来源:BaseContactSelectorFragment.java

示例2: onCreate

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onCreate(@Nullable Bundle bundle) {
	super.onCreate(bundle);

	setContentView(getLayout());

	if (bundle != null) {
		// restore group ID if it was saved
		byte[] groupBytes = bundle.getByteArray(GROUP_ID);
		if (groupBytes != null) groupId = new GroupId(groupBytes);
		// restore selected contacts if a selection was saved
		ArrayList<Integer> intContacts =
				bundle.getIntegerArrayList(CONTACTS);
		if (intContacts != null) {
			contacts = getContactsFromIntegers(intContacts);
		}
	}
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:19,代码来源:ContactSelectorActivity.java

示例3: returnTTSData

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Receive the audio and sync data from the TTS engine
 * The it checks if the data received is valid or there as an error on the request
 * @param result A Bundle containing a byte[] and a ArrayList<Integer>
 */
@Override
public void returnTTSData(Bundle result) {
    //Check if the activity is still alive when the async call come back
    if(getActivity() != null) {
        boolValues.put("waiting",false);
        if (result.getByteArray("audio") == null || result.getIntegerArrayList("tokens") == null) {
            if (audioPlayer != null && (audioPlayer.isPlaying() == true || boolValues.get("isPaused"))) {
                boolValues.put("netErrorBoolean", true);
                //netErrorBoolean = true;
            } else {
                netError();
            }
            return;
        }
        bufferAudio.add(result.getByteArray("audio"));
        bufferSyncData.add(result.getIntegerArrayList("tokens"));
        startPlayer();
    }
}
 
开发者ID:Visions-Team,项目名称:eBread,代码行数:25,代码来源:ShowDocumentFragment.java

示例4: addRowsToNumbersList

import android.os.Bundle; //导入方法依赖的package包/类
private void addRowsToNumbersList(Bundle data) {
    if (data == null) {
        return;
    }
    // get numbers and types from parameters
    ArrayList<String> numbers = data.getStringArrayList(CONTACT_NUMBERS);
    ArrayList<Integer> types = data.getIntegerArrayList(CONTACT_NUMBER_TYPES);
    if (numbers != null && types != null && numbers.size() == types.size()) {
        // get the set of unique pairs of numbers/types form the current view
        Set<Pair<String, Integer>> numbers2TypeSet = getNumber2TypePairs();
        for (int i = 0; i < numbers.size(); i++) {
            String number = numbers.get(i);
            int type = types.get(i);
            // add to View only rows with unique pair of number/type
            if (numbers2TypeSet.add(new Pair<>(number, type))) {
                addRowToNumbersList(number, type);
            }
        }
    }
}
 
开发者ID:kaliturin,项目名称:BlackList,代码行数:21,代码来源:AddOrEditContactFragment.java

示例5: onResult

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected Bundle onResult(int which) {
    Bundle result = super.onResult(which);
    if (result != null) {

        ArrayList<Integer> positions = result.getIntegerArrayList(SELECTED_POSITIONS);
        if (positions != null) {
            ArrayList<String> labels = new ArrayList<>(positions.size());
            for (Integer pos : positions) {
                labels.add(mData.get(pos).getString());
            }
            result.putStringArrayList(SELECTED_LABELS, labels);
        }

        if (result.containsKey(SELECTED_SINGLE_POSITION)) {
            result.putString(SELECTED_SINGLE_LABEL, mData.get(
                    result.getInt(SELECTED_SINGLE_POSITION)).getString());
        }

    }
    return result;
}
 
开发者ID:eltos,项目名称:SimpleDialogFragments,代码行数:23,代码来源:SimpleListDialog.java

示例6: onCreateLoader

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Loader onCreateLoader(final int id, final Bundle args) {
    switch (id) {
        case SavedEntriesQueryLoader.ID:
            return new SavedEntriesQueryLoader(getActivity(), getSortOrder());
        case SavedEntriesDeleteLoader.ID:
            return new SavedEntriesDeleteLoader(getActivity(),
                    args.getIntegerArrayList(KEY_POSITIONS));
        default:
            return null;
    }
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:13,代码来源:SavedEntriesFragment.java

示例7: readInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
private void readInstanceState(Bundle savedInstanceState) {
    if (savedInstanceState != null) {

        ArrayList<Integer> checkedPos = savedInstanceState.getIntegerArrayList(getStateKey());
        if (checkedPos != null && checkedPos.size() > 0) {
            mItemsToCheck = new ArrayList<Integer>();
            for (int pos : checkedPos) {
                mItemsToCheck.add(pos);
            }
        }
    }
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:13,代码来源:MultiSelectionUtil.java

示例8: unbundle

import android.os.Bundle; //导入方法依赖的package包/类
public static TestClassBundled unbundle(Bundle bundle, Gson gson) {
    return new AutoValue_TestClassBundled(
            bundle,
            bundle.getByte("some_byte"),
            bundle.getBoolean("some_boolean"),
            bundle.getShort("some_short"),
            bundle.getInt("some_int"),
            bundle.getLong("some_long"),
            bundle.getChar("some_char"),
            bundle.getFloat("some_float"),
            bundle.getDouble("some_double"),
            bundle.getString("some_string"),
            bundle.getCharSequence("some_char_sequence"),
            bundle.getParcelable("some_parcelable"),
            bundle.getParcelableArrayList("some_parcelable_array_list"),
            bundle.getSparseParcelableArray("some_parcelable_sparse_array"),
            bundle.getSerializable("some_serializable"),
            bundle.getIntegerArrayList("some_integer_array_list"),
            bundle.getStringArrayList("some_string_array_list"),
            bundle.getCharSequenceArrayList("some_char_sequence_array_list"),
            bundle.getByteArray("some_byte_array"),
            bundle.getShortArray("some_short_array"),
            bundle.getCharArray("some_char_array"),
            bundle.getFloatArray("some_float_array"),
            gson.fromJson(bundle.getString("some_unknown_object"), new com.google.common.reflect.TypeToken<UnknownObject>(){}.getType()),
            gson.fromJson(bundle.getString("some_unknown_object_list"), new com.google.common.reflect.TypeToken<ArrayList<UnknownObject>>(){}.getType()),
            gson.fromJson(bundle.getString("test_enum"), new com.google.common.reflect.TypeToken<TestEnum>(){}.getType()));
}
 
开发者ID:uber,项目名称:auto-value-bundle,代码行数:29,代码来源:AutoValue_TestClassBundled.java

示例9: getIntegerArrayList

import android.os.Bundle; //导入方法依赖的package包/类
public ArrayList<Integer> getIntegerArrayList(Bundle state, String key) {
    return state.getIntegerArrayList(key + baseKey);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Injector.java

示例10: getIntegerArrayList

import android.os.Bundle; //导入方法依赖的package包/类
public ArrayList<Integer> getIntegerArrayList(Bundle state, String key) {
    return state.getIntegerArrayList(key + mBaseKey);
}
 
开发者ID:evernote,项目名称:android-state,代码行数:4,代码来源:InjectionHelper.java

示例11: get

import android.os.Bundle; //导入方法依赖的package包/类
@Nullable
@Override
public List<Integer> get(@NonNull String key, @NonNull Bundle bundle) {
    return bundle.getIntegerArrayList(key);
}
 
开发者ID:evernote,项目名称:android-state,代码行数:6,代码来源:BundlerListInteger.java

示例12: onCreate

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle bundle = getIntent().getBundleExtra("bundle");

    LinearLayout linearLayout = new LinearLayout(this);
    linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    setContentView(linearLayout);

    TextView textView = new TextView(this);
    textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER));
    linearLayout.addView(textView);

    ArrayList<Integer> intList =bundle.getIntegerArrayList("extra");

    StringBuilder stringBuilder = new StringBuilder();

    for(int item:intList){
        stringBuilder.append(item+" ");
    }

    textView.setText("The bundle param is : year -> list:{" +stringBuilder+ "}" );
}
 
开发者ID:zktufo,项目名称:NavRouter,代码行数:26,代码来源:SubTestActivity.java

示例13: onRestoreInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Restore the previous state of the selection on the items.
 *
 * @param savedInstanceState
 */
public void onRestoreInstanceState(Bundle savedInstanceState) {
    selectedItems = savedInstanceState.getIntegerArrayList(TAG) != null ? savedInstanceState.getIntegerArrayList(TAG) : selectedItems;
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:9,代码来源:SelectableAdapter.java


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