Example usage for android.os Bundle putLong

List of usage examples for android.os Bundle putLong

Introduction

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

Prototype

public void putLong(@Nullable String key, long value) 

Source Link

Document

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

Usage

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserListSubscriptions(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;//from  w w  w .  j  av  a2s  . co  m
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserListSubscriptionsFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        args.putLong(INTENT_KEY_USER_ID, user_id);
        args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_LIST_SUBSCRIPTIONS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserListTypes(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;/*from ww  w.j a  v a 2 s. c o m*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserListTypesFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        args.putLong(INTENT_KEY_USER_ID, user_id);
        args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_LIST_TYPES);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserProfile(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;/*from ww  w . jav  a2s .c om*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserProfileFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (user_id > 0) {
            args.putLong(INTENT_KEY_USER_ID, user_id);
        }
        if (screen_name != null) {
            args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_RIGHT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_USER);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openTweetSearch(final Activity activity, final long account_id, final String query,
        final int search_id) {
    if (activity == null)
        return;//from  ww w  .  java  2 s. c o m
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new SearchTweetsFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (query != null) {
            args.putString(INTENT_KEY_QUERY, query);
        }
        if (search_id > 0) {
            args.putInt(INTENT_KEY_ID, search_id);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_SEARCH);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        builder.appendQueryParameter(QUERY_PARAM_TYPE, QUERY_PARAM_VALUE_TWEETS);
        if (query != null) {
            builder.appendQueryParameter(QUERY_PARAM_QUERY, query);
        }
        if (search_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_ID, String.valueOf(search_id));
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserFavorites(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;// w w w . j a v  a  2  s  . c om
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserFavoritesFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (user_id > 0) {
            args.putLong(INTENT_KEY_USER_ID, user_id);
        }
        if (screen_name != null) {
            args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_USER_FAVORITES);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }

}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserFollowers(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;//from   w w  w  .  ja  v  a2s  . com
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserFollowersFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (user_id > 0) {
            args.putLong(INTENT_KEY_USER_ID, user_id);
        }
        if (screen_name != null) {
            args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_USER_FOLLOWERS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }

}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserFriends(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;//from   w  ww.ja  v  a 2s.  c o  m
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserFriendsFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (user_id > 0) {
            args.putLong(INTENT_KEY_USER_ID, user_id);
        }
        if (screen_name != null) {
            args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_USER_FRIENDS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }

}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserTimeline(final Activity activity, final long account_id, final long user_id,
        final String screen_name) {
    if (activity == null)
        return;/*from   w ww  . j ava  2  s .c  o m*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserTimelineFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        if (user_id > 0) {
            args.putLong(INTENT_KEY_USER_ID, user_id);
        }
        if (screen_name != null) {
            args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        }
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_USER_TIMELINE);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }

}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserListDetails(final Activity activity, final long account_id, final int list_id,
        final long user_id, final String screen_name, final String list_name) {
    if (activity == null)
        return;/*from  w  ww. j  a  v a 2 s  . c  o  m*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserListDetailsFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        args.putInt(INTENT_KEY_LIST_ID, list_id);
        args.putLong(INTENT_KEY_USER_ID, user_id);
        args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        args.putString(INTENT_KEY_LIST_NAME, list_name);
        fragment.setArguments(args);
        dual_pane_activity.showFragment(fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_LIST_DETAILS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (list_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_LIST_ID, String.valueOf(list_id));
        }
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        if (list_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_LIST_NAME, list_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}

From source file:com.dwdesign.tweetings.util.Utils.java

public static void openUserListMembers(final Activity activity, final long account_id, final int list_id,
        final long user_id, final String screen_name, final String list_name) {
    if (activity == null)
        return;/*from  www. j  ava2  s.c  o  m*/
    if (activity instanceof DualPaneActivity && ((DualPaneActivity) activity).isDualPaneMode()) {
        final DualPaneActivity dual_pane_activity = (DualPaneActivity) activity;
        final Fragment fragment = new UserListMembersFragment();
        final Bundle args = new Bundle();
        args.putLong(INTENT_KEY_ACCOUNT_ID, account_id);
        args.putInt(INTENT_KEY_LIST_ID, list_id);
        args.putLong(INTENT_KEY_USER_ID, user_id);
        args.putString(INTENT_KEY_SCREEN_NAME, screen_name);
        args.putString(INTENT_KEY_LIST_NAME, list_name);
        fragment.setArguments(args);
        dual_pane_activity.showAtPane(DualPaneActivity.PANE_LEFT, fragment, true);
    } else {
        final Uri.Builder builder = new Uri.Builder();
        builder.scheme(SCHEME_TWEETINGS);
        builder.authority(AUTHORITY_LIST_MEMBERS);
        builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        if (list_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_LIST_ID, String.valueOf(list_id));
        }
        if (user_id > 0) {
            builder.appendQueryParameter(QUERY_PARAM_USER_ID, String.valueOf(user_id));
        }
        if (screen_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_SCREEN_NAME, screen_name);
        }
        if (list_name != null) {
            builder.appendQueryParameter(QUERY_PARAM_LIST_NAME, list_name);
        }
        activity.startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
    }
}