Example usage for android.os Bundle getLong

List of usage examples for android.os Bundle getLong

Introduction

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

Prototype

public long getLong(String key) 

Source Link

Document

Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key.

Usage

From source file:com.wit.android.support.database.loremipsum.BaseLoremIpsumEntity.java

/**
 * <h3>Projection:</h3>/*from  www. j av a  2s. c  om*/
 * [{@link #ID}, {@link #TITLE}, {@link #NOTE}, {@link #DATE}, {@link #COUNT}, {@link #ENABLED},
 * {@link #EMPTY}]
 *
 * @param params todo
 * @return todo
 */
@NonNull
public Loader<Cursor> createDetailLoader(@Nullable Bundle params) {
    // Prepare selection.
    final IdSelection selection = new IdSelection(ID, params != null ? params.getLong(ID) : 0);
    return LoaderOptions.createLoader(getContext(), getContentUri(),
            new String[] { ID, TITLE, NAME, DESCRIPTION, DATE, EDITABLE, EMPTY }, selection.build(),
            selection.buildArgs());
}

From source file:com.dabay6.android.apps.carlog.ui.base.BaseNavigationVehicleSelectorActivity.java

/**
 * {@inheritDoc}/* ww w . jav  a  2 s .  c  o m*/
 */
@Override
protected void onCreate(final Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(KEY_VEHICLE_ID)) {
            vehicleId = savedInstanceState.getLong(KEY_VEHICLE_ID);
            vehicleId = (vehicleId == -1) ? null : vehicleId;
        }
    }

    super.onCreate(savedInstanceState);

    if (isLoadedOnCreate()) {
        startLoader();
    }
}

From source file:com.guayaba.tapir.ui.fragments.profile.AlbumSongFragment.java

/**
 * {@inheritDoc}//from   w  w w.  ja v  a 2s.co  m
 */
@Override
public Loader<List<Song>> onCreateLoader(final int id, final Bundle args) {
    return new AlbumSongLoader(getActivity(), args.getLong(Config.ID));
}

From source file:com.guayaba.tapir.ui.fragments.profile.ArtistSongFragment.java

/**
 * {@inheritDoc}/*  w  w w . j ava2s  .co m*/
 */
@Override
public Loader<List<Song>> onCreateLoader(final int id, final Bundle args) {
    return new ArtistSongLoader(getActivity(), args.getLong(Config.ID));
}

From source file:com.example.android.ennis.barrett.popularmovies.DetailFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mRootView = inflater.inflate(R.layout.fragment_detail, container, false);

    if (savedInstanceState != null) {
        mID = savedInstanceState.getLong(ID_KEY);
    }// w ww .  j  a  v  a2 s.  c  om

    return mRootView;
}

From source file:com.vuze.android.remote.dialog.DialogFragmentMoveData.java

private void setupVars(View view) {
    Bundle args = getArguments();
    String name = args.getString("name");
    torrentId = args.getLong("id");
    String downloadDir = args.getString("downloadDir");
    history = args.getStringArrayList("history");

    ArrayList<String> newHistory = new ArrayList<>();
    if (history != null) {
        newHistory.addAll(history);//from   w w  w.j a v  a  2 s  .  c o  m
    }

    if (downloadDir != null && !newHistory.contains(downloadDir)) {
        if (newHistory.size() > 1) {
            newHistory.add(1, downloadDir);
        } else {
            newHistory.add(downloadDir);
        }
    }

    etLocation = (EditText) view.findViewById(R.id.movedata_editview);
    if (downloadDir != null) {
        etLocation.setText(downloadDir);
    }
    ListView lvHistory = (ListView) view.findViewById(R.id.movedata_historylist);
    cbRememberLocation = (CheckBox) view.findViewById(R.id.movedata_remember);
    TextView tv = (TextView) view.findViewById(R.id.movedata_label);

    tv.setText(getResources().getString(R.string.movedata_label, name));

    ArrayAdapter<String> adapter = new ArrayAdapter<>(view.getContext(), R.layout.list_view_small_font,
            newHistory);
    lvHistory.setAdapter(adapter);

    lvHistory.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, final View view, int position, long id) {
            Object item = parent.getItemAtPosition(position);

            if (item instanceof String) {
                etLocation.setText((String) item);
            }
        }
    });

}

From source file:com.cyanogenmod.eleven.ui.fragments.ArtistDetailFragment.java

@Override
protected void onViewCreated() {
    super.onViewCreated();

    getContainingActivity().setFragmentPadding(false);

    Bundle arguments = getArguments();
    mArtistName = arguments.getString(Config.ARTIST_NAME);
    mArtistId = arguments.getLong(Config.ID);

    setupPopupMenuHelpers();//  w  ww . j  av  a2s  .c  o m
    setupSongList();
    setupAlbumList();
    setupHero(mArtistName);

    LoaderManager lm = getLoaderManager();
    lm.initLoader(ALBUM_LOADER_ID, arguments, mAlbumAdapter);
    lm.initLoader(SONG_LOADER_ID, arguments, mSongAdapter);
}

From source file:com.guayaba.tapir.ui.fragments.profile.GenreSongFragment.java

/**
 * {@inheritDoc}/* w  ww.  j  ava2  s . c  o m*/
 */
@Override
public Loader<List<Song>> onCreateLoader(final int id, final Bundle args) {
    return new GenreSongLoader(getActivity(), args.getLong(Config.ID));
}

From source file:com.andryr.musicplayer.fragments.AlbumFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle args = getArguments();
    if (args != null) {

        long id = args.getLong(ARG_ID);
        String title = args.getString(ARG_NAME);
        String artist = args.getString(ARG_ARTIST);
        int year = args.getInt(ARG_YEAR);
        int trackCount = args.getInt(ARG_TRACK_COUNT);

        mAlbum = new Album(id, title, artist, year, trackCount);

    }// w ww  .  ja v a  2  s. co  m

    mArtworkWidth = getResources().getDimensionPixelSize(R.dimen.artist_image_req_width);
    mArtworkHeight = getResources().getDimensionPixelSize(R.dimen.artist_image_req_height);
}

From source file:com.nextgis.ngm_clink_monitoring.fragments.ObjectTypesFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRetainInstance(true);//from w w  w.j  a va  2s  .c  om

    if (null != savedInstanceState) {
        mLineRemoteId = savedInstanceState.getLong(FoclConstants.FOCL_STRUCT_REMOTE_ID);
    }
}