Example usage for android.os Bundle remove

List of usage examples for android.os Bundle remove

Introduction

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

Prototype

public void remove(String key) 

Source Link

Document

Removes any entry with the given key from the mapping of this Bundle.

Usage

From source file:org.mariotaku.twidere.fragment.support.AbsUserListsFragment.java

@Override
public final Loader<Data> onCreateLoader(int id, Bundle args) {
    final boolean fromUser = args.getBoolean(EXTRA_FROM_USER);
    args.remove(EXTRA_FROM_USER);
    return onCreateUserListsLoader(getActivity(), args, fromUser);
}

From source file:com.kklop.ghostmode.HighScore.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.highscore);//from ww  w  .j a v  a 2s .  c o m
    Bundle extras = this.getIntent().getExtras();

    if (extras != null) {
        score = (Integer) extras.get("score");
        extras.remove("score");
        //Toast toast = Toast.makeText(getApplicationContext(), getString(R.string.score_info).concat(Integer.toString(score)), Toast.LENGTH_SHORT);
        //toast.show();
        if (HighScoreDbHelper.isHighScore(getApplicationContext(), score)) {
            openDialog();
        }
    }
    final ListView listview = (ListView) findViewById(R.id.listview);
    list = new ArrayList<String>();
    addTitle();
    updateHighScores();

    adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
    listview.setAdapter(adapter);

}

From source file:org.mariotaku.twidere.fragment.ParcelableGroupsFragment.java

@Override
public final Loader<List<ParcelableGroup>> onCreateLoader(int id, Bundle args) {
    final boolean fromUser = args.getBoolean(EXTRA_FROM_USER);
    args.remove(EXTRA_FROM_USER);
    return onCreateUserListsLoader(getActivity(), args, fromUser);
}

From source file:org.microg.gms.gcm.SendReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    if (intent.getExtras() == null)
        return;/*from  w w w  . j a  v a2 s . c o m*/
    Bundle extras = intent.getExtras();
    Log.d("GmsMcsSendRcvr", "original extras: " + extras);
    for (String key : extras.keySet()) {
        if (key.startsWith("GOOG.") || key.startsWith("GOOGLE.")) {
            extras.remove(key);
        }
    }
    Intent i = new Intent(context, McsService.class);
    i.setAction(ACTION_SEND);
    i.putExtras(extras);
    startWakefulService(context, i);
}

From source file:org.mariotaku.twidere.fragment.ParcelableUserListsFragment.java

@Override
public final Loader<List<ParcelableUserList>> onCreateLoader(int id, Bundle args) {
    final boolean fromUser = args.getBoolean(EXTRA_FROM_USER);
    args.remove(EXTRA_FROM_USER);
    return onCreateUserListsLoader(getActivity(), args, fromUser);
}

From source file:joshuatee.wx.WX.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    if (savedInstanceState != null) {
        savedInstanceState.remove("android:support:fragments");
    }/*from   w  w w.j  av a 2s.  c o  m*/

    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    theme_blue_current = preferences.getString("THEME_BLUE", "");
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.main);

    simple_mode_current = preferences.getString("SIMPLE_MODE", "");

    if (!DataStore.loaded)
        DataStore.Init(this);

    viewPager = (ViewPager) findViewById(R.id.pager);
    actionBar = getActionBar();
    mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
    viewPager.setAdapter(mAdapter);
    viewPager.setOffscreenPageLimit(4);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    if (simple_mode_current.startsWith("f")) {
        for (String tab_name : tabs) {
            actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
        }
    } else {
        for (String tab_name : tabs_simple) {
            actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
        }
    }

    viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });

    refresh_dynamic_content();

}

From source file:org.mariotaku.twidere.fragment.ParcelableUsersFragment.java

@Override
public final Loader<List<ParcelableUser>> onCreateLoader(int id, Bundle args) {
    final boolean fromUser = args.getBoolean(EXTRA_FROM_USER);
    args.remove(EXTRA_FROM_USER);
    return onCreateUsersLoader(getActivity(), args, fromUser);
}

From source file:es.glasspixel.wlanaudit.activities.NetworkListActivitySwipe.java

/**
 * Lifecycle management: Activity must save its state
 *//*w ww .  j a  v a2 s  . c o  m*/
@Override
protected void onSaveInstanceState(Bundle outState) {
    outState.remove("android:support:fragments");
}

From source file:com.facebook.internal.FacebookWebFallbackDialog.java

@Override
protected Bundle parseResponseUri(String url) {
    Uri responseUri = Uri.parse(url);//from w ww .ja  v  a 2s.  com
    Bundle queryParams = Utility.parseUrlQueryString(responseUri.getQuery());

    // Convert Bridge args to the format that the Native dialog code understands.
    String bridgeArgsJSONString = queryParams.getString(ServerProtocol.FALLBACK_DIALOG_PARAM_BRIDGE_ARGS);
    queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_BRIDGE_ARGS);

    if (!Utility.isNullOrEmpty(bridgeArgsJSONString)) {
        Bundle bridgeArgs;
        try {
            JSONObject bridgeArgsJSON = new JSONObject(bridgeArgsJSONString);
            bridgeArgs = BundleJSONConverter.convertToBundle(bridgeArgsJSON);
            queryParams.putBundle(NativeProtocol.EXTRA_PROTOCOL_BRIDGE_ARGS, bridgeArgs);
        } catch (JSONException je) {
            Utility.logd(TAG, "Unable to parse bridge_args JSON", je);
        }
    }

    // Convert Method results to the format that the Native dialog code understands.
    String methodResultsJSONString = queryParams.getString(ServerProtocol.FALLBACK_DIALOG_PARAM_METHOD_RESULTS);
    queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_METHOD_RESULTS);

    if (!Utility.isNullOrEmpty(methodResultsJSONString)) {
        methodResultsJSONString = Utility.isNullOrEmpty(methodResultsJSONString) ? "{}"
                : methodResultsJSONString;
        Bundle methodResults;
        try {
            JSONObject methodArgsJSON = new JSONObject(methodResultsJSONString);
            methodResults = BundleJSONConverter.convertToBundle(methodArgsJSON);
            queryParams.putBundle(NativeProtocol.EXTRA_PROTOCOL_METHOD_RESULTS, methodResults);
        } catch (JSONException je) {
            Utility.logd(TAG, "Unable to parse bridge_args JSON", je);
        }
    }

    // The web host does not send a numeric version back. Put the latest known version in there so NativeProtocol
    // can continue parsing the response.
    queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_VERSION);
    queryParams.putInt(NativeProtocol.EXTRA_PROTOCOL_VERSION, NativeProtocol.getLatestKnownVersion());

    return queryParams;
}

From source file:org.onebusaway.android.ui.TripPlanActivity.java

@Override
public void onTripRequestReady() {

    // Remove results fragment if it exists
    Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.trip_results_fragment_container);
    if (fragment != null) {
        getSupportFragmentManager().beginTransaction().remove(fragment).commit();
    }//from w  ww .j a  v a  2s . c  om

    mTripRequest = mBuilder.setListener(this).execute(this);

    // clear out selected itinerary from bundle
    Bundle bundle = mBuilder.getBundle();
    bundle.remove(OTPConstants.ITINERARIES);
    bundle.remove(OTPConstants.SELECTED_ITINERARY);

    ObaAnalytics.reportEventWithCategory(ObaAnalytics.ObaEventCategory.SUBMIT.toString(),
            getString(R.string.analytics_action_trip_plan), getString(R.string.analytics_label_trip_plan));

    showProgressDialog();
}