Android Bundle - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Bundle class.

This code example shows how to use the following methods:putInt, putString, putStringArrayList
 
 
	public static FolderItemListFragment newInstance(ArrayList<String> feedIds, String folderName, int currentState) {
		FolderItemListFragment feedItemFragment = new FolderItemListFragment();
 
		Bundle args = new Bundle();
		args.putInt("currentState", currentState);
		args.putStringArrayList("feedIds", feedIds);
		args.putString("folderName", folderName);
		feedItemFragment.setArguments(args);
 
		return feedItemFragment;
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		currentState = getArguments().getInt("currentState");
		folderName = getArguments().getString("folderName");
		ArrayList<String> feedIdArrayList = getArguments().getStringArrayList("feedIds");
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putCharSequence, putSerializable
     * 
     * @param raw 
     * @param repo 
     */ 
    public void setText(final String raw, final IRepositoryIdProvider repo) {
        Bundle args = new Bundle();
        args.putCharSequence(ARG_TEXT, raw);
        if (repo instanceof Serializable)
            args.putSerializable(ARG_REPO, (Serializable) repo);
        getLoaderManager().restartLoader(0, args, this);
        Keyboard.hideSoftInput(bodyText);
        showLoading(true); 
    } 
 
    private void showLoading(final boolean loading) {
        ViewUtils.setGone(progress, !loading);
        ViewUtils.setGone(bodyText, loading);
    } 
 
    @Override 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putInt, putString
	private Cursor feedCursor;
 
	public static FeedItemListFragment newInstance(String feedId, int currentState) {
		FeedItemListFragment feedItemFragment = new FeedItemListFragment();
 
		Bundle args = new Bundle();
		args.putInt("currentState", currentState);
		args.putString("feedId", feedId);
		feedItemFragment.setArguments(args);
 
		return feedItemFragment;
	} 
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		currentState = getArguments().getInt("currentState");
		feedId = getArguments().getString("feedId");
 
		if (!NetworkUtils.isOnline(getActivity())) { 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getString
            Log.v("python service", "service exists, do not start again");
            return START_NOT_STICKY;
        } 
 
        Bundle extras = intent.getExtras();
        androidPrivate = extras.getString("androidPrivate");
        // service code is located in service subdir 
        androidArgument = extras.getString("androidArgument") + "/service";
        pythonHome = extras.getString("pythonHome");
        pythonPath = extras.getString("pythonPath");
        pythonServiceArgument = extras.getString("pythonServiceArgument");
        String serviceTitle = extras.getString("serviceTitle");
        String serviceDescription = extras.getString("serviceDescription");
 
        pythonThread = new Thread(this);
        pythonThread.start();
 
        Context context = getApplicationContext();
        Notification notification = new Notification(context.getApplicationInfo().icon,
                serviceTitle,
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putInt
         */ 
        static CountingFragment newInstance(int num) {
            CountingFragment f = new CountingFragment();
 
            // Supply num input as an argument. 
            Bundle args = new Bundle();
            args.putInt("num", num);
            f.setArguments(args);
 
            return f;
        } 
 
        /** 
         * When creating, retrieve this instance's number from its arguments. 
         */ 
        @Override 
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            mNum = getArguments() != null ? getArguments().getInt("num") : 1;
        } 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:containsKey, putFloat, remove
    assertEquals(0, bundle.getFloat("foo"), 0.005f);
  } 
 
  @Test 
  public void testRemove() { 
    bundle.putFloat("foo", 5f);
    bundle.putFloat("foo2", 5f);
 
    bundle.remove("foo");
 
    assertFalse(bundle.containsKey("foo"));
    assertTrue(bundle.containsKey("foo2"));
  } 
 
  @Test 
  public void testClear() { 
    bundle.putFloat("foo", 5f);
 
    bundle.clear();
 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getString
This code example shows how to use the following methods:putInt
		adapter.swapCursor(cursor);
	} 
 
	public static ItemListFragment newInstance(int currentState) {
		ItemListFragment everythingFragment = new AllStoriesItemListFragment();
		Bundle arguments = new Bundle();
		arguments.putInt("currentState", currentState);
		everythingFragment.setArguments(arguments);
 
		return everythingFragment;
	} 
 
	@Override 
	public void onScroll(AbsListView view, int firstVisible, int visibleCount, int totalCount) {
		if (firstVisible + visibleCount == totalCount && !requestedPage && doRequest) {
			currentPage += 1;
			requestedPage = true;
			((ItemsList) getActivity()).triggerRefresh(currentPage);
		} 
	} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putInt, putString
     * @param requestCode 
     * @return bundle 
     */ 
    protected static Bundle createArguments(final String title,
            final String message, final int requestCode) {
        Bundle arguments = new Bundle();
        arguments.putInt(ARG_REQUEST_CODE, requestCode);
        arguments.putString(ARG_TITLE, title);
        arguments.putString(ARG_MESSAGE, message);
        return arguments;
    } 
 
    /** 
     * Call back to the activity with the dialog result 
     * 
     * @param resultCode 
     */ 
    protected void onResult(final int resultCode) {
        final DialogFragmentActivity activity = (DialogFragmentActivity) getActivity();
        if (activity != null) {
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putCharSequence, putInt
  private EditText editor=null;
 
  static EditorFragment newInstance(int position,
                                    CharSequence text) {
    EditorFragment frag=new EditorFragment();
    Bundle args=new Bundle();
 
    args.putInt(KEY_POSITION, position);
    args.putCharSequence(KEY_TEXT, text);
    frag.setArguments(args);
 
    return(frag);
  } 
 
  @Override 
  public View onCreateView(LayoutInflater inflater,
                           ViewGroup container,
                           Bundle savedInstanceState) {
    View result=inflater.inflate(R.layout.editor, container, false);
     
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android Bundle Questions & Answers:

Other Android Bundle Examples

1:	protected void onCreate(Bundle savedInstanceState) {
2:	  super.onCreate(savedInstanceState);
3:

Read More

6:	  /** Called when the activity is first created. */
7:	  @Override
8:	  public void onCreate(Bundle savedInstanceState) {
9:	    super.onCreate(savedInstanceState);
10:	    setContentView(new ImageViewWithZoom(this));

Read More

7:	public class ScrollViewActivity extends Activity {
8:	    @Override
9:	    public void onCreate(Bundle savedInstanceState) {
10:	        super.onCreate(savedInstanceState);
11:	        setContentView(R.layout.activity_main);

Read More

3:		 */
4:		@Override
5:		protected void onSaveInstanceState(Bundle outState) {
6:			super.onSaveInstanceState(outState);
7:	
-
15:		 */
16:		@Override
17:		protected void onRestoreInstanceState(Bundle savedInstanceState) {
18:			super.onRestoreInstanceState(savedInstanceState);
19:

Read More

7:		 /** Called when the activity is first created. */
8:	    @Override
9:	    public void onCreate(Bundle savedInstanceState) {
10:	        super.onCreate(savedInstanceState);
11:	        setContentView(R.layout.news_feed_layout);

Read More

4:	
5:	public class VideosActivity extends Activity {
6:	    public void onCreate(Bundle savedInstanceState) {
7:	        super.onCreate(savedInstanceState);
8:	        setContentView(R.layout.videos_layout);

Read More

1:	public void onCreate(Bundle savedInstanceState) {
2:	    super.onCreate(savedInstanceState);
3:	    setContentView(R.layout.main_layout);

Read More

1:	public class ExampleActivity extends Activity implements OnClickListener {
2:	    protected void onCreate(Bundle savedValues) {
3:	        ...
4:	        Button button = (Button)findViewById(R.id.corky);

Read More

6:	};
7:	
8:	protected void onCreate(Bundle savedValues) {
9:	    ...
10:	    // Capture our button from layout

Read More

See Code Examples for Android Bundle Methods: