本文整理匯總了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();
}
}