當前位置: 首頁>>代碼示例>>Java>>正文


Java Bundle.putBinder方法代碼示例

本文整理匯總了Java中android.os.Bundle.putBinder方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.putBinder方法的具體用法?Java Bundle.putBinder怎麽用?Java Bundle.putBinder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putBinder方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendCommand

import android.os.Bundle; //導入方法依賴的package包/類
public static void sendCommand(Context context,ResolveInfo resolveInfo,int cmd) {
	
	ServiceInfo serviceInfo = resolveInfo.serviceInfo;
	String sender = serviceInfo.packageName;
	Intent intent = new Intent();
	intent.setAction(serviceInfo.packageName+"._SERVICE_");
	intent.setPackage(sender);
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_BINDER, ServiceManagerThread.getDefault());
	binderBunder.putString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME, sender);
	
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, cmd);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendCommand start service pkg name = "+serviceInfo.packageName+", class name = " + serviceInfo.name);
	
	ComponentName componentName = context.startService(intent);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendCommand start service result = " + componentName);
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:21,代碼來源:RemoteCommandSender.java

示例2: sendServerCommand

import android.os.Bundle; //導入方法依賴的package包/類
public static void sendServerCommand(Context context,int cmd,IBinder callback){
	Intent intent = new Intent();
	intent.setAction(ServiceContext.ACTION_REMOTE_CLIENT_COMMAND);
	intent.setPackage(ServiceContext.SERVER_PACKAGE_NAME);
	
	String sender = context.getPackageName();
	
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_SERVER_READY_BINDER, callback);
	binderBunder.putString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME, sender);
	
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, cmd);
	
	ComponentName componentName = context.startService(intent);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendServerCommand start service result = " + componentName);
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:19,代碼來源:RemoteCommandSender.java

示例3: attachToActivityManagerService

import android.os.Bundle; //導入方法依賴的package包/類
private static void attachToActivityManagerService(Context context) {
	
	LogControler.print(Level.INFO, "[ServerManagerThread] attach To ActivityManagerService");
	
	Intent intent = new Intent(ServiceContext.ACTION_RECEIVE_SERVICE_MANAGER);
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_BINDER, ServiceManagerThread.getDefault());
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, ServiceContext.CMD_CREATE_CLIENT_SERVICE_MANAGER);
	context.sendStickyBroadcast(intent);
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:12,代碼來源:ServiceManagerThread.java

示例4: writeRemoter

import android.os.Bundle; //導入方法依賴的package包/類
/**
 * Writes the @Remoter data
 */
private void writeRemoter(Object data, Bundle bundle, String keyPrefix) throws Exception {
    Class remoterInterfaceClass = getRemoterBinder(data);
    if (remoterInterfaceClass != null) {
        Class remoterStubClass = Class.forName(remoterInterfaceClass.getName() + "_Stub");
        Constructor constructor = remoterStubClass.getConstructor(remoterInterfaceClass);
        IBinder binder = (IBinder) constructor.newInstance(data);
        bundle.putString(RemoteEventManager.REMOTE_DATA_EXTRA + keyPrefix, remoterInterfaceClass.getName());
        bundle.putBinder(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix, binder);
    }
}
 
開發者ID:josesamuel,項目名稱:RxRemote,代碼行數:14,代碼來源:RemoteEventController.java

示例5: putBinder

import android.os.Bundle; //導入方法依賴的package包/類
public static void putBinder(Bundle bundle, String key, IBinder value) {
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        bundle.putBinder(key, value);
    } else {
        try {
            ReflectUtil.invoke(Bundle.class, bundle, "putIBinder", new Class[]{String.class, IBinder.class}, key, value);
        } catch (Exception e) {
        }
    }
}
 
開發者ID:didi,項目名稱:VirtualAPK,代碼行數:11,代碼來源:PluginUtil.java

示例6: putBinder

import android.os.Bundle; //導入方法依賴的package包/類
public static void putBinder(Bundle bundle, String key, IBinder value) {
	if (Build.VERSION.SDK_INT >= 18) {
		bundle.putBinder(key, value);
	} else {
		mirror.android.os.Bundle.putIBinder.call(bundle, key, value);
	}
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:8,代碼來源:BundleCompat.java

示例7: putBinder

import android.os.Bundle; //導入方法依賴的package包/類
public static void putBinder(Bundle bundle, String key, IBinder value) {
    if (Build.VERSION.SDK_INT >= 18) {
        bundle.putBinder(key, value);
    } else {
        mirror.android.os.Bundle.putIBinder.call(bundle, key, value);
    }
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:8,代碼來源:BundleCompat.java

示例8: putBinder

import android.os.Bundle; //導入方法依賴的package包/類
public static void putBinder(Bundle bundle, String key, IBinder binder) {
    bundle.putBinder(key, binder);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:BundleCompatJellybeanMR2.java

示例9: send

import android.os.Bundle; //導入方法依賴的package包/類
@Override
public Bundle send(Bundle bundle) {
	
	bundle.putBinder(ServiceContext.EXTRA_CALLBACK, new IBinderCallback(mCallback));
	
	return mBundleSender.send(bundle);
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:8,代碼來源:BundleSendDecorator.java


注:本文中的android.os.Bundle.putBinder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。