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, long defaultValue) 

Source Link

Document

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

Usage

From source file:com.dwdesign.tweetings.fragment.IncomingFriendshipsFragment.java

@Override
public Loader<List<ParcelableUser>> newLoaderInstance() {
    final Bundle args = getArguments();
    long account_id = -1, max_id = -1;
    if (args != null) {
        account_id = args.getLong(INTENT_KEY_ACCOUNT_ID, -1);
        max_id = args.getLong(INTENT_KEY_MAX_ID, -1);
    }/*from  ww  w . j a  v a  2 s .  c  o  m*/
    return new IncomingFriendshipsLoader(getActivity(), account_id, max_id, getData());
}

From source file:de.vanita5.twittnuker.fragment.support.RetweetsOfMeFragment.java

@Override
protected String[] getSavedStatusesFileArgs() {
    final Bundle args = getArguments();
    if (args == null)
        return null;
    final long account_id = args.getLong(EXTRA_ACCOUNT_ID, -1);
    return new String[] { AUTHORITY_RETWEETS_OF_ME, "account" + account_id };
}

From source file:de.mprengemann.hwr.timetabel.SubjectDetailActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    application = (TimetableApplication) getApplication();

    long evt_id = 0;
    long sub_id = 0;
    Bundle b;

    if ((b = getIntent().getExtras()) != null) {
        evt_id = b.getLong(SubjectDetailFragment.EXTRA_EVENT_ID, -1);
        sub_id = b.getLong(SubjectDetailFragment.EXTRA_SUBJECT_ID, -1);
    }/* w ww  .j a  v  a2  s . c  o  m*/

    setContentView(R.layout.fragment_subject_detail_pager);

    getSupportActionBar().setTitle(getString(R.string.menu_detail));

    SubjectDetailFragmentAdapter mAdapter = new SubjectDetailFragmentAdapter(
            (TimetableApplication) getApplication(), sub_id, evt_id, getSupportFragmentManager());

    ViewPager mPager = (ViewPager) findViewById(R.id.pager_subject);
    mPager.setAdapter(mAdapter);

    TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator_subject);
    indicator.setViewPager(mPager);
    indicator.setFooterIndicatorStyle(IndicatorStyle.None);

    indicator.setCurrentItem(application.getSubjectPosition(sub_id));

    getSupportActionBar().setDisplayShowTitleEnabled(true);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}

From source file:de.vanita5.twittnuker.fragment.support.CursorSupportUsersListFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        mNextCursor = savedInstanceState.getLong(EXTRA_NEXT_CURSOR, -1);
        mPrevCursor = savedInstanceState.getLong(EXTRA_PREV_CURSOR, -1);
    } else {//w  w w . j  a v  a 2  s .  c o  m
        mNextCursor = -1;
        mPrevCursor = -1;
    }
    super.onActivityCreated(savedInstanceState);
}

From source file:de.vanita5.twittnuker.fragment.support.SearchStatusesFragment.java

@Override
public Loader<List<ParcelableStatus>> newLoaderInstance(final Context context, final Bundle args) {
    if (args == null)
        return null;
    final long accountId = args.getLong(EXTRA_ACCOUNT_ID, -1);
    final long maxId = args.getLong(EXTRA_MAX_ID, -1);
    final long sinceId = args.getLong(EXTRA_SINCE_ID, -1);
    final String query = args.getString(EXTRA_QUERY);
    final int tabPosition = args.getInt(EXTRA_TAB_POSITION, -1);
    final IStatusesAdapter<List<ParcelableStatus>> adapter = getListAdapter();
    adapter.setHighlightKeyword(query.split(" "));
    return new TweetSearchLoader(getActivity(), accountId, query, maxId, sinceId, getData(),
            getSavedStatusesFileArgs(), tabPosition);
}

From source file:de.vanita5.twittnuker.fragment.support.SearchStatusesFragment.java

@Override
protected String[] getSavedStatusesFileArgs() {
    final Bundle args = getArguments();
    if (args == null)
        return null;
    final long account_id = args.getLong(EXTRA_ACCOUNT_ID, -1);
    final String query = args.getString(EXTRA_QUERY);
    return new String[] { AUTHORITY_SEARCH_TWEETS, "account" + account_id, "query" + query };
}

From source file:com.sweetiepiggy.littlepro.QuestionFragment.java

private void loadState(Bundle bundle) {
    long id = bundle.getLong(ARG_QUESTION_ID, -1);
    String question = bundle.getString(ARG_QUESTION);
    List<String> answerChoices = new ArrayList<String>(
            Arrays.asList(bundle.getStringArray(ARG_ANSWER_CHOICES)));
    mAnswer = bundle.getString(ARG_ANSWER);
    int points = bundle.getInt(ARG_POINTS);
    if (bundle.getBoolean(ARG_SUBMITTED, false)) {
        mSubmitted = true;/*from w w  w. j ava  2 s .  c o m*/
    }

    mQuestion = new Question(id, question, answerChoices, points);
}

From source file:de.vanita5.twittnuker.fragment.support.UserFavoritesFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    final Bundle args = getArguments();
    final long account_id = args != null ? args.getLong(EXTRA_ACCOUNT_ID, -1) : -1;
    final long user_id = args != null ? args.getLong(EXTRA_USER_ID, -1) : -1;
    final String screen_name = args != null ? args.getString(EXTRA_SCREEN_NAME) : null;
    final boolean is_my_timeline = user_id > 0 ? account_id == user_id
            : account_id == getAccountId(getActivity(), screen_name);
    final IStatusesAdapter<List<ParcelableStatus>> adapter = getListAdapter();
    adapter.setFavoritesHightlightDisabled(is_my_timeline);
    adapter.setFiltersEnabled(false);//from   w  w  w. j  a  va 2  s .  com
}

From source file:com.dwdesign.tweetings.fragment.UserFollowersFragment.java

@Override
public Loader<List<ParcelableUser>> newLoaderInstance() {
    final Bundle args = getArguments();
    long account_id = -1, max_id = -1, user_id = -1;
    String screen_name = null;//from ww w .  j a  va2  s  . c o m
    if (args != null) {
        account_id = args.getLong(INTENT_KEY_ACCOUNT_ID, -1);
        max_id = args.getLong(INTENT_KEY_MAX_ID, -1);
        user_id = args.getLong(INTENT_KEY_USER_ID, -1);
        screen_name = args.getString(INTENT_KEY_SCREEN_NAME);
    }
    return new UserFollowersLoader(getActivity(), account_id, user_id, screen_name, max_id, getData());
}

From source file:com.dwdesign.tweetings.fragment.UserFriendsFragment.java

@Override
public Loader<List<ParcelableUser>> newLoaderInstance() {
    final Bundle args = getArguments();
    long account_id = -1, max_id = -1, user_id = -1;
    String screen_name = null;//from   w w  w.j a  va2s  .  co m
    if (args != null) {
        account_id = args.getLong(INTENT_KEY_ACCOUNT_ID, -1);
        max_id = args.getLong(INTENT_KEY_MAX_ID, -1);
        user_id = args.getLong(INTENT_KEY_USER_ID, -1);
        screen_name = args.getString(INTENT_KEY_SCREEN_NAME);
    }
    return new UserFriendsLoader(getActivity(), account_id, user_id, screen_name, max_id, getData());
}