当前位置: 首页>>代码示例>>Java>>正文


Java Intent.setExtrasClassLoader方法代码示例

本文整理汇总了Java中android.content.Intent.setExtrasClassLoader方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.setExtrasClassLoader方法的具体用法?Java Intent.setExtrasClassLoader怎么用?Java Intent.setExtrasClassLoader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.setExtrasClassLoader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIntent

import android.content.Intent; //导入方法依赖的package包/类
private static Intent getIntent(Context context, IntentType intentType, DataCollector dataCollector, SiteToSiteClientConfig siteToSiteClientConfig, Integer requestCode, Parcelable transactionResultCallback) {
    Intent intent = new Intent(context, SiteToSiteRepeating.class);
    if (dataCollector != null) {
        intent.setExtrasClassLoader(dataCollector.getClass().getClassLoader());
    } else if (transactionResultCallback != null) {
        intent.setExtrasClassLoader(transactionResultCallback.getClass().getClassLoader());
    } else {
        intent.setExtrasClassLoader(siteToSiteClientConfig.getClass().getClassLoader());
    }
    intent.putExtra(SiteToSiteService.INTENT_TYPE, intentType.name());

    if (requestCode == null) {
        // Find unused requestCode
        PendingIntent existing;
        do {
            requestCode = random.nextInt();
            existing = PendingIntent.getBroadcast(context, requestCode, intent, PendingIntent.FLAG_NO_CREATE);
        } while (existing != null);
    }

    intent.putExtra(REQUEST_CODE, requestCode);
    SerializationUtils.putParcelable(dataCollector, intent, DATA_COLLECTOR);
    SerializationUtils.putParcelable(transactionResultCallback, intent, SiteToSiteService.TRANSACTION_RESULT_CALLBACK);
    SerializationUtils.putParcelable(siteToSiteClientConfig, intent, SiteToSiteService.SITE_TO_SITE_CONFIG);
    return intent;
}
 
开发者ID:hortonworks,项目名称:nifi-android-s2s,代码行数:27,代码来源:SiteToSiteRepeating.java

示例2: StackRemoteViewsFactory

import android.content.Intent; //导入方法依赖的package包/类
public StackRemoteViewsFactory(Context applicationContext, Intent intent) {
    Log.v(TAG, "StackRemoteViewsFactory");
    intent.setExtrasClassLoader(GitHubJourneyWidgetDataEntry.class.getClassLoader());
    this.context = applicationContext;
    appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, 1);
    Bundle bundle = intent.getBundleExtra("bundle");
    Parcelable[] items = bundle.getParcelableArray("parcelables");
    Log.v(TAG, "items size = " + items.length);

    if (items.length != 0) {
        widgetDatas = new ArrayList<>(items.length);
        for (Parcelable item : items) {
            widgetDatas.add((GitHubJourneyWidgetDataEntry) item);
        }
    } else {
        widgetDatas = new ArrayList<>(0);
    }
    Log.v(TAG, "widgetDatas" + widgetDatas.size());
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:20,代码来源:StackWidgetService.java

示例3: handleOnStartOne

import android.content.Intent; //导入方法依赖的package包/类
private void handleOnStartOne(Intent intent, int flags, int startIds) throws Exception {
    ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
    if (info != null) {
        Service service = (Service) this.mNameService.get(info.name);
        if (service != null) {
            intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
            Object token = findTokenByService(service);
            Integer integer = (Integer) this.mServiceTaskIds.get(token);
            if (integer == null) {
                integer = Integer.valueOf(-1);
            }
            int startId = integer.intValue() + 1;
            this.mServiceTaskIds.put(token, Integer.valueOf(startId));
            int res = service.onStartCommand(intent, flags, startId);
            QueuedWorkCompat.waitToFinish();
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:ServcesManager.java

示例4: handleMessage

import android.content.Intent; //导入方法依赖的package包/类
@Override
public boolean handleMessage(Message msg) {
    if (msg.what == LAUNCH_ACTIVITY) {
        // ActivityClientRecord r
        Object r = msg.obj;
        try {
            Intent intent = (Intent) ReflectUtil.getField(r.getClass(), r, "intent");
            intent.setExtrasClassLoader(VAInstrumentation.class.getClassLoader());
            ActivityInfo activityInfo = (ActivityInfo) ReflectUtil.getField(r.getClass(), r, "activityInfo");

            if (PluginUtil.isIntentFromPlugin(intent)) {
                int theme = PluginUtil.getTheme(mPluginManager.getHostContext(), intent);
                if (theme != 0) {
                    Log.i(TAG, "resolve theme, current theme:" + activityInfo.theme + "  after :0x" + Integer.toHexString(theme));
                    activityInfo.theme = theme;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    return false;
}
 
开发者ID:didi,项目名称:VirtualAPK,代码行数:25,代码来源:VAInstrumentation.java

示例5: sendIntent2Process

import android.content.Intent; //导入方法依赖的package包/类
private void sendIntent2Process(String target, Intent intent, boolean sync) throws RemoteException {
    if (LOG) {
        LogDebug.d(PLUGIN_TAG, "sendIntent2Process target=" + target + " intent=" + intent);
    }

    if (TextUtils.equals(target, IPC.getPluginHostProcessName())) {
        intent.setExtrasClassLoader(getClass().getClassLoader());
        if (sync) {
            LocalBroadcastHelper.sendBroadcastSyncUi(mContext, intent);
        } else {
            LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
        }
        return;
    }

    if (TextUtils.isEmpty(target)) {
        intent.setExtrasClassLoader(getClass().getClassLoader());
        if (sync) {
            LocalBroadcastHelper.sendBroadcastSyncUi(mContext, intent);
        } else {
            LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
        }
    }
    PluginProcessMain.sendIntent2Process(target, intent, sync);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:26,代码来源:PmHostSvc.java

示例6: handleOnStartOne

import android.content.Intent; //导入方法依赖的package包/类
private void handleOnStartOne(Intent intent, int flags, int startIds) throws Exception {
    ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
    if (info != null) {
        Service service = mNameService.get(info.name);
        if (service != null) {
            ClassLoader classLoader = getClassLoader(info.applicationInfo);
            intent.setExtrasClassLoader(classLoader);
            Object token = findTokenByService(service);
            Integer integer = mServiceTaskIds.get(token);
            if (integer == null) {
                integer = -1;
            }
            int startId = integer + 1;
            mServiceTaskIds.put(token, startId);
            int res = service.onStartCommand(intent, flags, startId);
            QueuedWorkCompat.waitToFinish();
        }
    }
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:20,代码来源:ServcesManager.java

示例7: handleServiceArgs

import android.content.Intent; //导入方法依赖的package包/类
private void handleServiceArgs(Intent serviceIntent,IBinder token){
    Service service = mActivateServices.get(token);
    if(service!=null){
        if(serviceIntent!=null) {
            serviceIntent.setExtrasClassLoader(service.getClassLoader());
        }
        service.onStartCommand(serviceIntent,Service.START_FLAG_RETRY,0);
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:10,代码来源:BaseDelegateService.java

示例8: handleOnTaskRemovedOne

import android.content.Intent; //导入方法依赖的package包/类
private void handleOnTaskRemovedOne(Intent intent) throws Exception {
    if (VERSION.SDK_INT >= 14) {
        ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
        if (info != null) {
            Service service = (Service) this.mNameService.get(info.name);
            if (service != null) {
                intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
                service.onTaskRemoved(intent);
                QueuedWorkCompat.waitToFinish();
            }
            QueuedWorkCompat.waitToFinish();
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:ServcesManager.java

示例9: handleOnBindOne

import android.content.Intent; //导入方法依赖的package包/类
private IBinder handleOnBindOne(Intent intent) throws Exception {
    ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
    if (info != null) {
        Service service = (Service) this.mNameService.get(info.name);
        if (service != null) {
            intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
            return service.onBind(intent);
        }
    }
    return null;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:ServcesManager.java

示例10: handleOnRebindOne

import android.content.Intent; //导入方法依赖的package包/类
private void handleOnRebindOne(Intent intent) throws Exception {
    ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
    if (info != null) {
        Service service = (Service) this.mNameService.get(info.name);
        if (service != null) {
            intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
            service.onRebind(intent);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:ServcesManager.java

示例11: handleOnUnbindOne

import android.content.Intent; //导入方法依赖的package包/类
private boolean handleOnUnbindOne(Intent intent) throws Exception {
    ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
    if (info == null) {
        return false;
    }
    Service service = (Service) this.mNameService.get(info.name);
    if (service == null) {
        return false;
    }
    intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
    return service.onUnbind(intent);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:ServcesManager.java

示例12: sendIntent

import android.content.Intent; //导入方法依赖的package包/类
private void sendIntent(Intent intent, boolean sync) throws RemoteException {
    if (LOG) {
        LogDebug.d(PLUGIN_TAG, "sendIntent pr=" + IPC.getCurrentProcessName() + " intent=" + intent);
    }
    intent.setExtrasClassLoader(getClass().getClassLoader());
    if (sync) {
        LocalBroadcastHelper.sendBroadcastSyncUi(mContext, intent);
    } else {
        LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
    }
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:12,代码来源:PluginProcessPer.java

示例13: handleActivityCreateBefore

import android.content.Intent; //导入方法依赖的package包/类
/**
 * @hide 内部方法,插件框架使用
 * 插件的Activity的onCreate调用前调用此方法
 * @param activity
 * @param savedInstanceState
 */
public void handleActivityCreateBefore(Activity activity, Bundle savedInstanceState) {
    if (LOG) {
        LogDebug.d(PLUGIN_TAG, "activity create before: " + activity.getClass().getName() + " this=" + activity.hashCode() + " taskid=" + activity.getTaskId());
    }

    // 对FragmentActivity做特殊处理
    if (savedInstanceState != null) {
        //
        savedInstanceState.setClassLoader(activity.getClassLoader());
        //
        try {
            savedInstanceState.remove("android:support:fragments");
        } catch (Throwable e) {
            if (LOGR) {
                LogRelease.e(PLUGIN_TAG, "a.c.b1: " + e.getMessage(), e);
            }
        }
    }

    // 对FragmentActivity做特殊处理
    Intent intent = activity.getIntent();
    if (intent != null) {
        intent.setExtrasClassLoader(activity.getClassLoader());
        activity.setTheme(getThemeId(activity, intent));
    }
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:33,代码来源:PluginLibraryInternalProxy.java

示例14: setIntentClassLoader

import android.content.Intent; //导入方法依赖的package包/类
private void setIntentClassLoader(Intent intent, ClassLoader classLoader) {
    try {
        Bundle mExtras = (Bundle) FieldUtils.readField(intent, "mExtras");
        if (mExtras != null) {
            mExtras.setClassLoader(classLoader);
        } else {
            Bundle value = new Bundle();
            value.setClassLoader(classLoader);
            FieldUtils.writeField(intent, "mExtras", value);
        }
    } catch (Exception e) {
    } finally {
        intent.setExtrasClassLoader(classLoader);
    }
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:16,代码来源:IActivityManagerHookHandle.java

示例15: handleOnTaskRemovedOne

import android.content.Intent; //导入方法依赖的package包/类
private void handleOnTaskRemovedOne(Intent intent) throws Exception {
    if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
        ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
        if (info != null) {
            Service service = mNameService.get(info.name);
            if (service != null) {
                ClassLoader classLoader = getClassLoader(info.applicationInfo);
                intent.setExtrasClassLoader(classLoader);
                service.onTaskRemoved(intent);
                QueuedWorkCompat.waitToFinish();
            }
            QueuedWorkCompat.waitToFinish();
        }
    }
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:16,代码来源:ServcesManager.java


注:本文中的android.content.Intent.setExtrasClassLoader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。