Example usage for android.os Bundle putByte

List of usage examples for android.os Bundle putByte

Introduction

In this page you can find the example usage for android.os Bundle putByte.

Prototype

@Override
public void putByte(@Nullable String key, byte value) 

Source Link

Document

Inserts a byte value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:org.ecmdroid.fragments.CellEditorDialogFragment.java

/**
 * Construct a new Editor Dialog Fragment
 * @param offset position of the byte to edit
 * @param value the byte value to edit//from  w ww.j av  a 2s  .com
 */
public static CellEditorDialogFragment newInstance(int offset, byte value) {
    CellEditorDialogFragment dialog = new CellEditorDialogFragment();
    Bundle args = new Bundle();
    args.putByte(VALUE, value);
    args.putInt(OFFSET, offset);
    dialog.setArguments(args);
    return dialog;
}

From source file:com.facebook.LegacyTokenCacheTest.java

private static void putByte(String key, Bundle bundle) {
    bundle.putByte(key, (byte) random.nextInt());
}

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Activities.MapActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putSerializable("Center", mapView.getMapPosition().getMapCenter());
    outState.putByte("ZoomLvl", mapView.getMapPosition().getZoomLevel());
}

From source file:paulscode.android.mupen64plusae.game.GameFragment.java

public static GameFragment newInstance(String romPath, String romMd5, String romCrc, String romHeaderName,
        byte romCountryCode, String romArtPath, String romGoodName, String romLegacySave, boolean doRestart) {
    GameFragment gameFragment = new GameFragment();
    Bundle args = new Bundle();

    args.putString(ActivityHelper.Keys.ROM_PATH, romPath);
    args.putString(ActivityHelper.Keys.ROM_MD5, romMd5);
    args.putString(ActivityHelper.Keys.ROM_CRC, romCrc);
    args.putString(ActivityHelper.Keys.ROM_HEADER_NAME, romHeaderName);
    args.putByte(ActivityHelper.Keys.ROM_COUNTRY_CODE, romCountryCode);
    args.putString(ActivityHelper.Keys.ROM_ART_PATH, romArtPath);
    args.putString(ActivityHelper.Keys.ROM_GOOD_NAME, romGoodName);
    args.putString(ActivityHelper.Keys.ROM_LEGACY_SAVE, romLegacySave);
    args.putBoolean(ActivityHelper.Keys.DO_RESTART, doRestart);
    gameFragment.setArguments(args);//from  w ww . j av a2  s  .  c om

    return gameFragment;
}

From source file:de.stadtrallye.rallyesoft.fragments.TasksOverviewFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putByte(Std.SIZE, size);
}

From source file:me.xiaopan.android.inject.sample.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    listView = new ListView(getBaseContext());
    setContentView(listView);/*from   w  w w . jav a2s.co m*/

    // SharedPreferences?
    PreferenceUtils.putBoolean(getBaseContext(), KEY_BOOLEAN, true);
    PreferenceUtils.putFloat(getBaseContext(), KEY_FLOAT, 10000f);
    PreferenceUtils.putInt(getBaseContext(), KEY_INT, 2000);
    PreferenceUtils.putLong(getBaseContext(), KEY_LONG, 50000);
    PreferenceUtils.putString(getBaseContext(), KEY_STRING, "Preference String");
    Set<String> stringSet = new HashSet<String>();
    stringSet.add("String Set 1");
    stringSet.add("String Set 2");
    stringSet.add("String Set 3");
    stringSet.add("String Set 4");
    PreferenceUtils.putStringSet(getBaseContext(), KEY_STRING_SET, stringSet);
    MyBean bean2 = new MyBean();
    bean2.setEmail("sky@xiaopan.me2");
    bean2.setName("?2");
    bean2.setSex("2");
    PreferenceUtils.putObject(getBaseContext(), KEY_JSON, bean2);
    PreferenceUtils.putString(getBaseContext(), KEY_ENUM, Sex.WOMAN.name());

    // ??
    String[] items = new String[] { "", "?", "FragmentDialog",
            "InjectAdapter", "InjectExpandableListAdapter" };
    listView.setAdapter(new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_list_item_1,
            android.R.id.text1, items));
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (position <= 2) {
                Bundle bundle = new Bundle();
                bundle.putBoolean(MainActivity.PARAM_BOOLEAN, true);
                bundle.putBooleanArray(MainActivity.PARAM_BOOLEAN_ARRAY, new boolean[] { true, false, true });
                bundle.putByte(MainActivity.PARAM_BYTE, (byte) 110);
                bundle.putByteArray(MainActivity.PARAM_BYTE_ARRAY, new byte[] { 111, 112, 113 });
                bundle.putChar(MainActivity.PARAM_CHAR, 'R');
                bundle.putCharArray(MainActivity.PARAM_CHAR_ARRAY, new char[] { 'c', 'h', 'a', 'r' });
                bundle.putCharSequence(MainActivity.PARAM_CHAR_SEQUENCE, "CharSequence");
                bundle.putCharSequenceArray(MainActivity.PARAM_CHAR_SEQUENCE_ARRAY,
                        new CharSequence[] { "Char", " ", "Sequence" });
                bundle.putDouble(MainActivity.PARAM_DOUBLE, 12.00d);
                bundle.putDoubleArray(MainActivity.PARAM_DOUBLE_ARRAY, new double[] { 12.01d, 12.02d, 12.03d });
                bundle.putFloat(MainActivity.PARAM_FLOAT, 13.00f);
                bundle.putFloatArray(MainActivity.PARAM_FLOAT_ARRAY, new float[] { 13.01f, 13.02f, 13.03f });
                bundle.putInt(MainActivity.PARAM_INT, 120);
                bundle.putIntArray(MainActivity.PARAM_INT_ARRAY, new int[] { 121, 122, 123, });
                bundle.putLong(MainActivity.PARAM_LONG, 12345);
                bundle.putLongArray(MainActivity.PARAM_LONG_ARRAY, new long[] { 12346, 12347, 12348 });
                bundle.putShort(MainActivity.PARAM_SHORT, (short) 2);
                bundle.putShortArray(MainActivity.PARAM_SHORT_ARRAY, new short[] { 3, 4, 5 });
                bundle.putString(MainActivity.PARAM_STRING, "String");
                bundle.putStringArray(MainActivity.PARAM_STRING_ARRAY,
                        new String[] { "String1", "String2", "String3" });

                // ??JSONBundle
                MyBean bean = new MyBean();
                bean.setEmail("sky@xiaopan.me");
                bean.setName("?");
                bean.setSex("");
                bundle.putString(PARAM_STRING_JSON, new Gson().toJson(bean));

                bundle.putString(MainActivity.PARAM_STRING_ENUM, Sex.WOMAN.name());

                // 
                ArrayList<String> stringList = new ArrayList<String>();
                stringList.add("ArrayList String 1");
                stringList.add("ArrayList String 2");
                stringList.add("ArrayList String 3");
                bundle.putStringArrayList(MainActivity.PARAM_STRING_ARRAY_LIST, stringList);
                switch (position) {
                case 0:
                    Second.SECOND_CHRONOGRAPH.lap();
                    Intent intent = new Intent(getBaseContext(), InjectTestActivity.class);
                    intent.putExtras(bundle);
                    startActivity(intent);
                    break;
                case 1:
                    Second.SECOND_CHRONOGRAPH.lap();
                    Intent intent2 = new Intent(getBaseContext(), NormalActivity.class);
                    intent2.putExtras(bundle);
                    startActivity(intent2);
                    break;
                case 2:
                    Second.SECOND_CHRONOGRAPH.lap();
                    new TestDialogFragment().show(getSupportFragmentManager(), "");
                    break;
                }
            } else {
                Class<?> targetClass = null;
                if (position == 3) {
                    targetClass = InjectAdapterActivity.class;
                } else if (position == 4) {
                    targetClass = InjectExpandableListAdapterActivity.class;
                }
                if (targetClass != null) {
                    startActivity(new Intent(getBaseContext(), targetClass));
                }
            }
        }
    });
}

From source file:com.frostwire.android.gui.fragments.BrowsePeerFragment.java

private void reloadFiles(byte fileType) {
    getLoaderManager().destroyLoader(LOADER_FILES_ID);
    Bundle bundle = new Bundle();
    bundle.putByte("fileType", fileType);
    getLoaderManager().restartLoader(LOADER_FILES_ID, bundle, this);
}

From source file:net.alexjf.tmm.fragments.DateIntervalBarFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putString(KEY_CURRENTSTARTDATE, dateTimeFormat.format(startDate.getTime()));
    outState.putString(KEY_CURRENTENDDATE, dateTimeFormat.format(endDate.getTime()));
    outState.putInt(KEY_SPINNERSELECTION, dateIntervalSpinner.getSelectedItemPosition());
    outState.putByte(KEY_STARTDATEEDIT, (byte) (startDateBeingEdited ? 1 : 0));
    super.onSaveInstanceState(outState);
}

From source file:com.near.chimerarevo.activities.MainActivity.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    savedInstanceState.putByte("prevSelection", prevSelection);
    super.onSaveInstanceState(savedInstanceState);
}

From source file:ua.com.spasetv.testintuitions.MainActivity.java

private void callFragmentResult(byte idFragment, byte totalCorrectAnswers) {
    if (fragment != null) {
        Bundle bundle = new Bundle();
        switch (idFragment) {
        case FRAGMENT_EXERCISE_ONE:
            fragment = new FragResultExercises();
            bundle.putInt(ID_FRAGMENT, FRAGMENT_EXERCISE_ONE);
            bundle.putByte(CORRECT_ANSW, totalCorrectAnswers);
            refreshMainScreen();//from  w w w  .j a  va2 s. c  o  m
            break;
        case FRAGMENT_EXERCISE_TWO:
            fragment = new FragResultExercises();
            bundle.putInt(ID_FRAGMENT, FRAGMENT_EXERCISE_TWO);
            bundle.putByte(CORRECT_ANSW, totalCorrectAnswers);
            refreshMainScreen();
            break;
        case FRAGMENT_EXERCISE_THREE:
            fragment = new FragResultExercises();
            bundle.putInt(ID_FRAGMENT, FRAGMENT_EXERCISE_THREE);
            bundle.putByte(CORRECT_ANSW, totalCorrectAnswers);
            refreshMainScreen();
            break;
        default:
            break;
        }
        ads.showAd(); //show ads before Fragment Result
        fragment.setArguments(bundle);
        fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.container, fragment).commit();
    }
}