" AndroidAnnotations "可靠吗?我已经搜索了它,但找不到很多文章(评论或教程).
我一直在考虑在我的项目中使用这个库,该项目已经有很多用户.在采用它之前,我需要一个良好的声誉.所以我的担心主要是,
提前致谢.
我正在尝试使用Android注释框架,因为它看起来非常强大.我完全坚持基于它配置我的第一个项目.我遵循了wiki的每一步,但是在构建之后它不会生成任何文件.
所以当我从清单中请求生成的类时:
<activity android:name=".MyActivity_"
android:label="@string/app_name">
Run Code Online (Sandbox Code Playgroud)
我得到一个例外:
java.lang.ClassNotFoundException
Run Code Online (Sandbox Code Playgroud)
我的活动与维基中的活动完全相同:
@EActivity(R.layout.main)
public class MyActivity extends Activity {
@ViewById
EditText myInput;
@ViewById(R.id.myTextView)
TextView textView;
@Click
void myButton() {
String name = myInput.getText().toString();
textView.setText("Hello "+name);
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
编辑:刚刚找到一个目录".apt_generated",但它在构建后是空的.
android annotations manifest classnotfoundexception android-annotations
当前,我正在尝试tsconfig.json中的新扩展功能,该功能允许开发人员拥有基本的tsconfig.json,其他模块可以扩展/修改。
它正在工作,尽管没有达到预期。不知何故,唯一可行的方法是在父配置和子配置中都指定Compileroptions.lib。
parent.tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"lib": [ // Lib compiler options defined!!!
"dom",
"es6"
]
},
"exclude": [
"node_modules"
],
"awesomeTypescriptLoaderOptions": {
"resolveGlobs": true,
"forkChecker": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
Run Code Online (Sandbox Code Playgroud)
child.tsconfig.json(预期)
{
"extends": "../parent.tsconfig.json",
}
Run Code Online (Sandbox Code Playgroud)
child.tsconfig.json(必须工作)
{
"extends": "../parent.tsconfig.json",
"compilerOptions": {
"lib": [ //Have to specify lib again ==> Double-u-t-f
"dom",
"es6"
]
}
}
Run Code Online (Sandbox Code Playgroud)
对此问题的一些建议将不胜感激。
干杯
我还没有找到任何关于如何做到这一点的例子.我假设基于这样的例子是不可能的:
@Bean(MyImplementation.class)
MyInterface myInterface;
Run Code Online (Sandbox Code Playgroud)
注入的类已经确定.
android unit-testing mocking ioc-container android-annotations
如何在Xcode中创建本机窗口并将其与Mobile Flex应用程序集成.本机窗口应该与StageWebView组件类似,其中本机内容浮动在Flex应用程序的其余部分的矩形区域中.
使用注释和java配置我不太清楚如何为spring security注册一个重写的过滤器.
我想要实现的是在不显示登录表单的情况下进行自动登录,因为此时用户已经过身份验证.因此,只会读取标题参数并使用spring security进行授权.
这是我正在尝试的简化版本,Spring安全性正常工作,除了有时显示登录屏幕.引导BypassLoginFilter是我需要的全部内容.另外在某处读取http自动配置应该关闭这种行为,但不知道如何在纯java配置中实现.
SecurityWebApplicationInitializer.java
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer{
}
Run Code Online (Sandbox Code Playgroud)
SecurityConfig .java
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled=true, prePostEnabled=true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.authorizeRequests().antMatchers("/*").permitAll()
.anyRequest().hasRole("USER").and()
.formLogin()
.permitAll();
http.addFilterBefore(new BypassLoginFilter(), LogoutFilter.class);
//.and().anonymous().disable();
}
@Override
@Autowired
protected void registerAuthentication(AuthenticationManagerBuilder auth) {
try …
Run Code Online (Sandbox Code Playgroud) 当RoboGuice触发Event时,我的事件回调将在哪里执行,在哪个线程?例如,我有一个活动(@Observes OnUpdateUiEvent e).我还有一个后台线程,它会触发新的OnUpdateUiEvent("data").那么,我的do()方法将在我理解的bg线程中执行?如果我使用AndroidAnnotations中的@Background注释do(),会是什么?预处理器是否应该在runInUiThread()中调用do()?
如果一切正常,我认为这种模式将提供线程之间最简单的通信方式.
是否可以从您的本机代码返回结构?返回int或boolean是相对简单的,但是如何将更复杂的结构返回到actionscript?
我正在编写一个扩展,允许 Flex 应用程序访问 Android 的本机图像选择器。我能够毫无问题地启动图像选择器活动,但是在它返回到调用方(一个 FREFunction 对象)之后,不会调用 onActivityResult。因此,我无法弄清楚用户选择了什么图像。
当我在原生 Android 应用程序中使用完全相同的 FREFunction 内容时,该应用程序工作正常,并且我能够在 onActivityResult 中检索所选图像的 URI。我怎样才能让 onActivityResult 触发,或者至少检索图像选择器活动返回的信息?
我有一个从ListActivity继承并使用AndroidAnnotations的活动.虽然.onListItemClick
工作正常,但列表项的上下文菜单根本不会显示,甚至.onCreateContextMenu
不会被调用,但是.onListItemClick
在长时间点击列表项后会触发.这是我的代码:
@OptionsMenu(R.menu.places)
@EActivity(R.layout.places)
public class PlacesPicker extends ListActivity {
private static String[] DATA_SOURCE = { PlacesDB.PLACE_NAME, PlacesDB.PLACE_DESC };
private static int[] DATA_DESTINATION = { R.id.place_name, R.id.place_desc };
public static ListView lv;
@Bean
PlacesDB db;
Cursor cursor;
@AfterInject
public void init() {
cursor = db.getPlaces(null, null);
startManagingCursor(cursor);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.place_item, cursor, DATA_SOURCE, DATA_DESTINATION);
setListAdapter(adapter);
lv = getListView();
registerForContextMenu(lv);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) …
Run Code Online (Sandbox Code Playgroud) android ×6
air ×2
apache-flex ×2
adobe ×1
annotations ×1
concurrency ×1
contextmenu ×1
events ×1
flash ×1
inheritance ×1
ios ×1
java ×1
listactivity ×1
manifest ×1
mocking ×1
native ×1
roboguice ×1
screensaver ×1
spring ×1
tsconfig ×1
typescript ×1
unit-testing ×1
xcode ×1