SparseArray remove - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SparseArray remove method.

This code example shows how to use the following methods:remove
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        super.destroyItem(container, position, object);
 
        fragments.remove(position);
    } 
 
    @Override 
    public Object instantiateItem(ViewGroup container, int position) {
        Object fragment = super.instantiateItem(container, position);
        if (fragment instanceof IssueFragment)
            fragments.put(position, (IssueFragment) fragment);
        return fragment;
    } 
 
    @Override 
    public int getCount() { 
        return issues.length;
    } 
7
CodeRank
This code example shows how to use the following methods:remove, size
    } 
     
    public void remove(String name, int uid) {
        SparseArray<E> uids = mMap.get(name);
        if (uids != null) {
            uids.remove(uid);
            if (uids.size() == 0) {
                mMap.remove(name);
            } 
        } 
    } 
     
    public HashMap<String, SparseArray<E>> getMap() {
        return mMap;
    } 
} 
7
CodeRank
This code example shows how to use the following methods:get, indexOfKey, remove
		 * NakamapUtil().nakamapSetup(this); } 
		 */ 
	} 
 
	public OnActivityResultCallback getActivityCallback(int requestCode) { 
		if (_activityCallbacks.indexOfKey(requestCode) >= 0) { 
			OnActivityResultCallback found = _activityCallbacks 
					.get(requestCode); 
			_activityCallbacks.remove(requestCode); 
			return found; 
		} 
		else { 
			return null; 
		} 
	} 
 
	public void putActivityCallback(int requestCode, 
			OnActivityResultCallback callback) { 
		_activityCallbacks.put(requestCode, callback); 
	} 
6
CodeRank
This code example shows how to use the following methods:get, remove, size
     * Gets UsbDeviceConnection by a hierarchy device number 
     * @param devNum hierarchy device number 
     * @return UsbDeviceConnection or null 
     */ 
    public UsbDeviceConnection connection(int ch) {
        if(ch >= mConnection.size()) { return null; }
        return mConnection.get(ch);
    } 
 
    /** 
     * Check whether a device is connected or not 
     * @param devNum hierarchy device number 
     * @return true:connected, false:not connected 
     */ 
    public boolean deviceIsConnected(int devNum) {
        if(connection(devNum) == null) return false;
        return true; 
    } 
 
    /** 

5
CodeRank
This code example shows how to use the following methods:remove, size
    } 
     
    public void remove(String name, int uid) {
        SparseArray<E> uids = mMap.get(name);
        if (uids != null) {
            uids.remove(uid);
            if (uids.size() == 0) {
                mMap.remove(name);
            } 
        } 
    } 
     
    public HashMap<String, SparseArray<E>> getMap() {
        return mMap;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:get, remove
    } 
 
    // Implementation of InputManager.InputDeviceListener.onInputDeviceRemoved() 
    @Override 
    public void onInputDeviceRemoved(int deviceId) {
        InputDeviceState state = mInputDeviceStates.get(deviceId);
        if (state != null) {
            Log.i(TAG, "Device removed: " + state.mDevice);
            mInputDeviceStates.remove(deviceId);
        } 
    } 
 
    private static boolean isJoystick(int source) {
        return (source & InputDevice.SOURCE_CLASS_JOYSTICK) != 0;
    } 
 
    /** 
     * Tracks the state of joystick axes and game controller buttons for a particular 
     * input device for diagnostic purposes. 
     */ 
5
CodeRank
This code example shows how to use the following methods:remove
	 * @param key 
	 *            The unique series key. 
	 */ 
	public void removeSeriesPlot(int key)
	{ 
		history.remove(key);
		series.remove(key);
	} 
 
	/** 
	 * Create the plot. 
	 */ 
	private void initPlot() 
	{ 
		this.dynamicPlot.setRangeBoundaries(minRange, maxRange,
				BoundaryMode.FIXED); 
		this.dynamicPlot.setDomainBoundaries(0, windowSize, BoundaryMode.FIXED);
 
		this.dynamicPlot.setDomainStepValue(5);
		this.dynamicPlot.setTicksPerRangeLabel(3);
4
CodeRank
This code example shows how to use the following methods:remove
	} 
 
	@Override 
	public void destroyItem(ViewGroup container, int position, Object object) 
	{ 
		mPages.remove(position);
		super.destroyItem(container, position, object); /* super 필수! */
	} 
 
	/* 
	 * Listeners 
	 */ 
	@Override 
    public CharSequence getPageTitle(int position) 
	{ 
        return mTabs.get(position).tag;
    } 
 
	@Override 
	public void onPageScrollStateChanged(int arg0) 
4
CodeRank
This code example shows how to use the following methods:remove
	public void observeStatus(int status, ProtocolStatusListener listener) { 
		this.observedStatuses.put(status, listener); 
	} 
	 
	public void removeObserveStatus(int status) { 
		this.observedStatuses.remove(status); 
	} 
	 
	/** 
	 * Performs a GET request with no params. 
	 *  
	 * If no base url is set, the route passed in will be the full route used. 
	 *  
	 * @param route 
	 * @param responseHandler 
	 */ 
	public void doGet(String route, final DebuggedProtocolResponse responseHandler) { 
		this.doGet(route, new HashMap<String, Object>(), responseHandler); 
	} 
	 
3
CodeRank
This code example shows how to use the following methods:remove
    /** 
     * Removes an {@code ActionItem} 
     * @param actionType The action type of the item to remove 
     */ 
    public void removeAction(int actionType) {
        mActions.remove(actionType);
        if(mActionMode != null) mActionMode.invalidate();
    } 
 
    /** 
     * @return The {@code ActionItem}s 
     */ 
    public SparseArray<ActionItem> getActions() {
        return mActions;
    } 
 
    /** 
     * @return The {@code ActionMode} 
     */ 
    public ActionMode getActionMode() {
4
CodeRank
remove Method Overview
Alias for delete(int).
See Code Examples for other Android SparseArray Methods: