當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。