本文整理汇总了Java中android.os.Bundle.getBinder方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.getBinder方法的具体用法?Java Bundle.getBinder怎么用?Java Bundle.getBinder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.getBinder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBinder
import android.os.Bundle; //导入方法依赖的package包/类
public static IBinder getBinder(Bundle bundle, String key) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
return bundle.getBinder(key);
} else {
try {
return (IBinder) ReflectUtil.invoke(Bundle.class, bundle, "getIBinder", key);
} catch (Exception e) {
}
return null;
}
}
示例2: getBinder
import android.os.Bundle; //导入方法依赖的package包/类
public static IBinder getBinder(Bundle bundle, String key) {
if (Build.VERSION.SDK_INT >= 18) {
return bundle.getBinder(key);
} else {
return mirror.android.os.Bundle.getIBinder.call(bundle, key);
}
}
示例3: onTransact
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
throws RemoteException {
if(code == ServiceContext.TRANSACT_BUNDLE_SENDER) {
Bundle bundle = data.readBundle();
IBinder binder = bundle.getBinder(ServiceContext.EXTRA_CALLBACK);
Bundle result = onReceiver(bundle,new IBinderCallback(binder));
reply.writeBundle(result);
}
return true;
}
示例4: getBinder
import android.os.Bundle; //导入方法依赖的package包/类
public static IBinder getBinder(Bundle bundle, String key) {
if (Build.VERSION.SDK_INT >= 18) {
return bundle.getBinder(key);
} else {
return mirror.android.os.Bundle.getIBinder.call(bundle, key);
}
}
示例5: createClientServiceManager
import android.os.Bundle; //导入方法依赖的package包/类
static ServiceManagerImpl createClientServiceManager(Context context,Intent intent) {
log("createClientServiceManager");
Bundle binders = intent.getBundleExtra(ServiceContext.EXTRA_BUNDLE);
IBinder remoteServiceManager = binders.getBinder(ServiceContext.EXTRA_BUNDLE_BINDER);
int cmd = intent.getIntExtra(ServiceContext.EXTRA_COMMAND, ServiceContext.CMD_CREATE_CLIENT_SERVICE_MANAGER);
log("createClientServiceManager cmd = " + cmd);
ServiceManagerImpl serviceManager = ServiceManagerImpl.createLocalServiceManager(context, remoteServiceManager);
return serviceManager;
}
示例6: getBinder
import android.os.Bundle; //导入方法依赖的package包/类
public static IBinder getBinder(Bundle bundle, String key) {
return bundle.getBinder(key);
}
示例7: onHandleCommand
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onHandleCommand(int cmd, Intent intent) {
if(cmd == ServiceContext.CMD_GET_SERVER_SERVICE_MANAGER) {
Bundle binders = intent.getBundleExtra(ServiceContext.EXTRA_BUNDLE);
IBinder serverReadyBinder = binders.getBinder(ServiceContext.EXTRA_BUNDLE_SERVER_READY_BINDER);
String packageName = binders.getString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME);
ServerReadyNotifier serverReadyNotifier = new ServerReadyNotifier(packageName,serverReadyBinder);
serverReadyNotifier.runInCoreThread();
}
}