Java tutorial
//package com.java2s; import android.os.Bundle; public class Main { public static Bundle getBundle(Bundle oldBundle, Bundle newBundle) { if (oldBundle == null) { if (newBundle == null) { return new Bundle(); } else { return newBundle; } } else { if (newBundle == null) { return new Bundle(); } else { oldBundle.putAll(newBundle); return oldBundle; } } } }