我在哪里可以找到android.graphics.Canvas类的原生实现的源代码?
我想在用户点击地图的地图上显示一个标记。同样,这不应影响双击以进行缩放和/或移动Mapview。
我正在使用osmdroid-android-4.0.jar
我已经安装Nexus在Ubuntu 18.04 LTS. 当我想启动Nexus服务时出现此错误:
nexus[24049]: No suitable Java Virtual Machine could be found on your system.
nexus[24049]: The version of the JVM must be at least 1.8 and at most 1.8.
nexus[24049]: Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
systemd[1]: nexus.service: Control process exited, code=exited status=83
systemd[1]: nexus.service: Failed with result 'exit-code'.
systemd[1]: Failed to start LSB: nexus.
Run Code Online (Sandbox Code Playgroud)
我已经Open JDK version 10.0.2在我的系统中安装了:
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build …Run Code Online (Sandbox Code Playgroud) 我按照链接保护 HTTP 端点中的描述在我的应用程序中添加安全性。我收到无法找到 HttpSecurity bean 的错误。我添加的代码如下:
@Configuration
@EnableWebSecurity
public class SecurityConfiguration {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.requestMatcher(EndpointRequest.toAnyEndpoint()).authorizeRequests(requests ->
requests.anyRequest().hasRole("ENDPOINT_ADMIN"));
http.httpBasic();
return http.build();
}
}
Run Code Online (Sandbox Code Playgroud)
没有添加任何其他内容。我还在 pom.xml 中添加了 spring-boot-starter-security。但是,如果我使用 WebSecurityConfigurerAdapter 并使用重写的配置方法扩展该类,则它可以正常工作。
例外是:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityFilterChain' defined in class path resource [SecurityConfiguration.class]: Unsatisfied dependency expressed through method 'securityFilterChain' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.config.annotation.web.builders.HttpSecurity' available: expected at least 1 bean which qualifies as autowire candidate. …Run Code Online (Sandbox Code Playgroud) 我想将照片添加到MediaStore,以便Gallery应用程序可以找到它们(无需重新启动设备).App的min sdk是9.任何帮助,博客或文档赞赏.
我正在编写一个应用程序,在某些情况下用警报声警告用户.我的问题是,在某些情况下,媒体播放的音量可能会被用户减少,甚至媒体音量也是沉默的.我想以编程方式检查卷并将其增加到100%然后播放警报.
任何的想法?请注意,我已经测试mediaPlayer.setVolume(1,1),没有任何改变.
我有一个osmdroid MapView,它有很多标记,在很多时候相互重叠.有没有办法将选定的标记带到像z-index这样的东西?
创建独立库应用程序是Eclipse + ADT中的常见任务.我认为这应该是Android Studio(1.2或更高版本)中的一个简单任务,但在经历了两天这个问题的努力之后,我发现google没有对此做任何事情并且实现一个独立的库模块并不像我想象的那么简单.所以我决定与你分享我的经历.
我想将从geofabrik.de下载的.osm文件转换为.map以在MapsForge中使用.我已经安装了osmosis及其MapsForge插件.当我想将osm文件转换为映射文件时,我收到此错误/异常:
crosby.binary.file.FileFormatException: Unexpectedly long header 65536 bytes. Possibly corrupt file.
at crosby.binary.file.FileBlockHead.readHead(FileBlockHead.java:50)
at crosby.binary.file.FileBlock.process(FileBlock.java:130)
at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34)
at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:37)
at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
我使用的命令行是:
osmosis --rb file=kyrgyzstan.osm --mapfile-writer file=kyrgyzstan.map type=hd
Run Code Online (Sandbox Code Playgroud)
任何的想法?
我有一个Android应用程序,需要激活才能在设备上工作.激活过程是通过短信发送加密密钥并通过短信获取加密回复来激活应用程序.假设加密/解密是安全的.问题是我必须存储应用程序状态(激活/未激活/激活失败)并在每次启动时读取它以查看该应用程序是否已激活.首选项和sqlite数据库不安全.保存这种状态的最佳方法是什么?
我有一个包含两个片段的大型布局文件:列表片段和细节片段.列表片段应根据传递给Activity的TYPE参数列出不同的数据.问题是当我在Activity的onCreate()方法中调用setContentView()方法时,片段创建,我无法将此参数传递给它.码:
公共类VideoPlayerActivity扩展了FragmentActivity {
Type type;
MyListFragment listFragment;
FragmentManager fragmentManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);
fragmentManager = getSupportFragmentManager();
Bundle extras = getIntent().getExtras();
if (extras != null && extras.containsKey(Constants.KEY_TYPE)) {
int type = extras.getInt(Constants.KEY_TYPE);
type = Type.getTypeByValue(type);
}
if (findViewById(R.id.fragment_container) != null) {
// Normal Screen Layout
if (savedInstanceState != null) {
return;
}
listFragment = new MyListFragment();
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, listFragment).commit();
} else {
// Large Screen layout
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
listFragment = (MyListFragment) fragmentManager.findFragmentById(R.id.listFragment);
}
}
Run Code Online (Sandbox Code Playgroud)
如果我new是活动,我可以在其onAttach()方法上调用一个方法来获取参数,但是在这个例子中我已经在xml布局中定义了Fragments,并且它们在活动创建时初始化.你有什么主意吗?
我正在使用MapStruct将实体转换为 DTO。
我有一个带有实体 B 列表的实体 A:
public class A {
List<B> bs;
}
Run Code Online (Sandbox Code Playgroud)
我想在 ADto 类中有一个 B id 列表:
public class ADto {
List<Long> bIds;
}
Run Code Online (Sandbox Code Playgroud) 我有一个ExpandableListView,一切都很好.当我点击子行时,我想在每个子行中有一个复选框,如下所示:
expandableListView.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
CheckBox checkBox = (CheckBox) v.findViewById(R.id.checkBox1);
checkBox.toggle();
return true;
}
});
Run Code Online (Sandbox Code Playgroud)
问题是程序永远不会进入onChildClick()事件处理程序.任何的想法?
android ×9
java ×2
osmdroid ×2
spring-boot ×2
cryptography ×1
eclipse ×1
encryption ×1
map ×1
mapstruct ×1
nexus ×1
nexus3 ×1
spring ×1