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


Java RoboInjector.getInstance方法代码示例

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


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

示例1: onCreate

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	final RoboInjector injector = RoboGuice.getInjector(this);
	eventManager = injector.getInstance(EventManager.class);
	injector.injectMembersWithoutViews(this);
	super.onCreate(savedInstanceState);
	eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
 
开发者ID:AMOS-2015,项目名称:amos-ss15-proj2,代码行数:9,代码来源:AbstractRoboDrawerActivity.java

示例2: onCreate

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent<Activity>(this, savedInstanceState));
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:9,代码来源:RoboAppCompatActivity.java

示例3: convert

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
/**
 * Convert the response URL from the new formats used in the Retrofit implementation, to the
 * previous formats used in the original Apache HTTP client implementation, which was what
 * populated this cache.
 *
 * @param url The URL to convert.
 * @return The converted URL.
 */
@NonNull
private String convert(@NonNull final String url) {
    /* The course structure URL was stripped of it's non-definitive query parameters before
     * being stored in the cache, to prevent it not becoming non-accessible after internal API
     * changes on the query parameters. The course ID parameter was retained, but not URL-
     * escaped.
     */
    if (courseStructureGetUrlConversionPattern == null) {
        final RoboInjector injector = RoboGuice.getInjector(context);
        final Config config = injector.getInstance(Config.class);
        String baseUrl = config.getApiHostURL();
        if (!baseUrl.endsWith("/")) {
            baseUrl += '/';
        }
        courseStructureGetUrlConversionPattern = Pattern.compile("^(" + baseUrl +
                "api/courses/v1/blocks/\\?)(?:[^=&;]+?=[^=&;]+?[&;])*?(course_id=)([^=&;]+)");
    }
    final Matcher urlMatcher = courseStructureGetUrlConversionPattern.matcher(url);
    if (urlMatcher.matches()) {
        final StringBuffer urlConversionBuffer = new StringBuffer(url.length());
        urlMatcher.appendReplacement(urlConversionBuffer,
                "$1$2" + Uri.decode(urlMatcher.group(3)));
        return urlConversionBuffer.toString();
    }
    return url;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:35,代码来源:CacheManager.java

示例4: onCreate

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent(savedInstanceState));
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:9,代码来源:RoboSherlockAccountAuthenticatorActivity.java

示例5: onCreate

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    final RoboInjector injector = RoboGuice.getInjector(this);
    eventManager = injector.getInstance(EventManager.class);
    preferenceListener = injector.getInstance(PreferenceListener.class);
    injector.injectMembersWithoutViews(this);
    super.onCreate(savedInstanceState);
    eventManager.fire(new OnCreateEvent(savedInstanceState));
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:10,代码来源:RoboSherlockPreferenceActivity.java

示例6: onCreate

import roboguice.inject.RoboInjector; //导入方法依赖的package包/类
@Override
protected void onCreate( Bundle savedInstanceState ) {

    final RoboInjector injector = RoboGuice.getInjector( this );
    eventManager = injector.getInstance( EventManager.class );
    injector.injectMembersWithoutViews( this );
    super.onCreate( savedInstanceState );
    eventManager.fire( new OnCreateEvent( savedInstanceState ) );
}
 
开发者ID:metova,项目名称:roboguice-appcompat,代码行数:10,代码来源:RoboActionBarActivity.java


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