Example usage for android.os Bundle putStringArray

List of usage examples for android.os Bundle putStringArray

Introduction

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

Prototype

public void putStringArray(@Nullable String key, @Nullable String[] value) 

Source Link

Document

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

Usage

From source file:org.bwgz.quotation.fragment.SubjectFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    Log.d(TAG, String.format("onCreateView - savedInstanceState: %s", savedInstanceState));

    View view = inflater.inflate(R.layout.subject_fragment, container, false);

    viewHolder = new ViewHolder();
    viewHolder.subject_name = (TextView) view.findViewById(R.id.subject_name);
    viewHolder.subject_image = (NetworkImageView) view.findViewById(R.id.subject_image);
    viewHolder.subject_description_short = (TextView) view.findViewById(R.id.subject_description_short);
    viewHolder.subject_description_full = (TextView) view.findViewById(R.id.subject_description_full);
    viewHolder.subject_description_layout = (LinearLayout) view.findViewById(R.id.subject_description_layout);
    viewHolder.subject_description_layout_short = (RelativeLayout) view
            .findViewById(R.id.subject_description_layout_short);
    viewHolder.subject_description_layout_full = (RelativeLayout) view
            .findViewById(R.id.subject_description_layout_full);
    viewHolder.quotation_grid = (GridView) view.findViewById(R.id.quotations);

    viewHolder.subject_description_layout.setOnClickListener(new ViewToggleOnClickListener(
            viewHolder.subject_description_layout_short, viewHolder.subject_description_layout_full));

    GridView gridView = viewHolder.quotation_grid;
    gridView.setOnItemClickListener(new GridViewOnItemClickListener(gridView));
    gridView.setAdapter(new LoadingAdapter());

    Bundle bundle = new Bundle();
    bundle.putParcelable(LOADER_BUNDLE_URI, Subject.withAppendedId(getPick().getId()));
    bundle.putStringArray(LOADER_BUNDLE_PROJECTION, new String[] { Subject._ID, Subject.NAME,
            Subject.DESCRIPTION, Subject.IMAGE_ID, BookmarkSubject.BOOKMARK_ID });
    subjectLoaderId = initLoader(this, bundle);

    quotationLoaderId = initLoader(this, SubjectQuotation.withAppendedId(getPick().getId()),
            QuotationQuery.PROJECTION, null, null, null);

    return view;/*from   w w  w.j  av  a  2  s.  com*/
}

From source file:de.aw.monma.mainscreen.FragmentFinanzen.java

@Override
protected void setInternalArguments(Bundle args) {
    super.setInternalArguments(args);
    args.putParcelable(DBDEFINITION, tbd);
    args.putInt(LAYOUT, layout);/*w  ww .  ja v  a  2 s.c o m*/
    args.putInt(VIEWHOLDERLAYOUT, viewHolderLayout);
    args.putStringArray(PROJECTION, projection);
    args.putString(ORDERBY, orderBy);
    args.putIntArray(VIEWRESIDS, viewResIDs);
    zeigeAusgeblendeteKonten = prefs.getBoolean(getString(R.string.menu_item_hideAccounts), false);
    if (!zeigeAusgeblendeteKonten) {
        String selection = " NOT " + column_ausgeblendet;
        args.putString(SELECTION, selection);
    }
}

From source file:uk.org.rivernile.edinburghbustracker.android.fragments.general.AddTimeAlertFragment.java

/**
 * {@inheritDoc}//from w  ww.j a  v  a2  s .  c  om
 */
@Override
public void onSaveInstanceState(final Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putStringArray(ARG_SELECTED_SERVICES, selectedServices);
}

From source file:es.esy.vivekrajendran.news.MainActivity.java

/**
 * A helper method to change fragments effortlessly
 * @param id param passed to specify fragment needs to be shown
 *//*from   w ww .  j  av a  2  s.co  m*/
private void changeFragment(int id) {
    Log.i("TAG", "changeFragment: " + id);
    switch (id) {
    case R.id.menu_btmnav_latest:
        Bundle bundle = new Bundle();
        bundle.putString("uri", NewsContract.News.CONTENT_URI.toString());
        bundle.putStringArray("projection", null);
        bundle.putString("selection", null);
        bundle.putStringArray("selectionArgs", null);
        bundle.putString("sortOrder", null);

        LatestNewsFragment latestNewsFragment = new LatestNewsFragment();
        latestNewsFragment.setArguments(bundle);
        getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, latestNewsFragment).commit();
        Log.i("TAG", "changeFragment: LatestNewsFragment");
        break;
    case R.id.menu_btmnav_provider:

        getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, new ProviderFragment())
                .commit();
        break;
    case R.id.menu_btmnav_starred:

        getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, new FavouritesFragment())
                .commit();
        break;
    default:
        throw new IllegalArgumentException("changeFragment: invalid id passed");
    }
}

From source file:eu.trentorise.smartcampus.jp.notifications.BroadcastNotificationsFragment.java

@Override
public void onStart() {
    super.onStart();
    ListView list = (ListView) getSherlockActivity().findViewById(R.id.bn_options_list);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(getSherlockActivity(),
            android.R.layout.simple_list_item_1, JPParamsHelper.getBroadcastNotificationsOptions());
    list.setAdapter(adapter);/* w ww  . j a va 2 s  . c om*/

    list.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            String itemtext = ((TextView) view).getText().toString();
            Bundle bundle = new Bundle();
            bundle.putString("itemtext", itemtext);

            SherlockFragment fragment = null;
            if (itemtext.contentEquals(getString(R.string.broadcast_notifications_bus_trento_delay))) {
                bundle.putStringArray(BT_DelayFormFragment.ARG_AGENCYIDS,
                        new String[] { RoutesHelper.AGENCYID_BUS_TRENTO });
                fragment = new BT_DelayFormFragment();
            } else if (itemtext.contentEquals(getString(R.string.broadcast_notifications_bus_rovereto_delay))) {
                bundle.putStringArray(BT_DelayFormFragment.ARG_AGENCYIDS,
                        new String[] { RoutesHelper.AGENCYID_BUS_ROVERETO });
                fragment = new BT_DelayFormFragment();
            } else if (itemtext.contentEquals(getString(R.string.broadcast_notifications_bus_suburban_delay))) {
                bundle.putStringArray(BT_DelayFormFragment.ARG_AGENCYIDS,
                        new String[] { RoutesHelper.AGENCYID_BUS_SUBURBAN });
                fragment = new BT_DelayFormFragment();
            } else if (itemtext.contentEquals(getString(R.string.broadcast_notifications_train_delay))) {
                bundle.putStringArray(BT_DelayFormFragment.ARG_AGENCYIDS,
                        new String[] { RoutesHelper.AGENCYID_TRAIN_BZVR, RoutesHelper.AGENCYID_TRAIN_TM,
                                RoutesHelper.AGENCYID_TRAIN_TNBDG });
                fragment = new BT_DelayFormFragment();
            } else {
                // fragment = new FormFragment();
                Toast.makeText(getSherlockActivity().getApplicationContext(), R.string.tmp, Toast.LENGTH_SHORT)
                        .show();
            }
            if (JPHelper.isUserAnonymous(getSherlockActivity())) {
                // show dialog box
                //Toast 
                //                Toast.makeText(getSherlockActivity(), "dialog upgrade", Toast.LENGTH_LONG).show();
                UserRegistration.upgradeuser(getSherlockActivity());
            } else if (fragment != null) {
                fragment.setArguments(bundle);
                FragmentTransaction fragmentTransaction = getSherlockActivity().getSupportFragmentManager()
                        .beginTransaction();
                // fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
                // fragmentTransaction.detach(self);
                fragmentTransaction.replace(Config.mainlayout, fragment, Config.NOTIFICATIONS);
                fragmentTransaction.addToBackStack(fragment.getTag());
                fragmentTransaction.commit();
            }
        }
    });

}

From source file:com.greendev.image.ImageGridFragment.java

@TargetApi(16)
@Override/*from  ww  w. ja  v a2s  .com*/
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

    /* transferring information to ImageDetailActivity */
    Bundle b = new Bundle();
    b.putStringArray("URLS_TYPE", typeUrls);
    b.putStringArray("CAPTIONS", captions);

    final Intent i = new Intent(context, ImageDetailActivity.class);
    i.putExtras(b);
    i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id);

    if (Utils.hasJellyBean()) {
        // makeThumbnailScaleUpAnimation() looks kind of ugly here as the
        // loading spinner may
        // show plus the thumbnail image in GridView is cropped. so using
        // makeScaleUpAnimation() instead.
        ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight());
        context.startActivity(i, options.toBundle());
    } else {
        startActivity(i);
    }
}

From source file:com.nishithkumar.popularmovies.MainActivity.java

protected void onSaveInstanceState(Bundle outState) {
    //outState.putParcelableArrayList("MOVIES", movieIds);
    outState.putStringArray("MOVIES", movieIds);
    Log.d(TAG, "onSaveInstanceState : Saved movies data! ");
    super.onSaveInstanceState(outState);
}

From source file:org.xdty.preference.colorpicker.ColorPickerDialog.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putIntArray(KEY_COLORS, mColors);
    outState.putInt(KEY_SELECTED_COLOR, mSelectedColor);
    outState.putStringArray(KEY_COLOR_CONTENT_DESCRIPTIONS, mColorContentDescriptions);
    outState.putString("key", key);
}

From source file:com.libreteam.taxi.Customer_Fragment_Activity.java

public void didAddFragment(Fragment frag, String var, String[] list, boolean isCheck) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    Bundle data = new Bundle();
    data.putStringArray(var, list);
    frag.setArguments(data);/*from w  ww  .  jav  a 2s  .  co  m*/
    ft.replace(R.id.activity_main_content_fragment, frag, "NewFragmentTag");
    if (isCheck)
        ft.addToBackStack(null);
    ft.commitAllowingStateLoss();
}

From source file:eu.trentorise.smartcampus.eb.fragments.experience.AssignCollectionFragment.java

@Override
public void onSaveInstanceState(Bundle out) {
    super.onSaveInstanceState(out);
    out.putBooleanArray("selected", selected == null ? new boolean[0] : selected);
    out.putStringArrayList("selectedIds",
            selectedIds == null ? new ArrayList<String>() : new ArrayList<String>(selectedIds));
    out.putStringArray("items", items);
}