Context unbindService - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:bindService, getPackageManager, unbindService
					else mReceivedOpenUDIDs.put(_openUDID, 1);
						 
				} 
			} 
		} catch (RemoteException e) {if (LOG) Log.e(TAG, "RemoteException: " + e.getMessage());}		    	    			
		mContext.unbindService(this);
		 
		startService(); //Try the next one 
  	} 
	 
	@Override 
	public void onServiceDisconnected(ComponentName className) {}
	 
	private void storeOpenUDID() { 
    	final Editor e = mPreferences.edit();
		e.putString(PREF_KEY, OpenUDID);
		e.commit();
	} 
	 
	/* 

7
CodeRank
This code example shows how to use the following methods:unbindService
		Intent serviceIntent = new Intent(context, mServiceClass);
		context.bindService(serviceIntent, mServiceConnection, Context.BIND_AUTO_CREATE);
	} 
	 
	public void unBind(){ 
		mContext.unbindService(mServiceConnection);
	} 
	 
	public T getServiceInterface() { 
		return mServiceInterface;
	} 
	 
	private ServiceConnection mServiceConnection = new ServiceConnection() {
 
		@Override 
		public void onServiceConnected(ComponentName name, IBinder service) { 
			try { 
				Method asInterface = null; 
				for(Class c : mInterfaceClass.getClasses()) { 
					String className = c.getSimpleName(); 
6
CodeRank
This code example shows how to use the following methods:unbindService
 
		if (mService != null) {
			boolean isAlive = mService.asBinder().isBinderAlive();
			clearService(true); // Processing performed before unbind. 
			if (isAlive)
				mContext.unbindService(this);
		} 
 
	} 
 
	/** 
	 * Call API. 
	 *  
	 * @param version 
	 *            API version. 
	 *  
	 * @param serverCode 
	 *            Service code. 
	 *  
	 * @param classCode 
6
CodeRank
This code example shows how to use the following methods:unbindService
    /** 
     * Disconnect 
     */ 
    public void disconnect() { 
        if ((mConnection != null) && (mSrcContext != null)) {
            mSrcContext.unbindService(mConnection);
        } 
        if (mSrcHandler != null) {
            replyDisconnected(STATUS_SUCCESSFUL);
        } 
    } 
 
    /** 
     * Send a message to the destination handler. 
     * 
     * @param msg 
     */ 
    public void sendMessage(Message msg) {
        msg.replyTo = mSrcMessenger;
        try { 
3
CodeRank

Related Context unbindService Questions & Answers:

unbindService Method Overview
Disconnect from an application service.
See Code Examples for other Android Context Methods: