草庐IT

uses_loop

全部标签

android - 如何从 startActivityForResult(Intent.createChooser(fileIntent, "Open file using..."), APP_PICKED); 获取用户选择?

在之后有没有办法以编程方式获取用户选择startActivityForResult(Intent.createChooser(fileIntent,"Openfileusing..."),APP_PICKED);或startActivity(Intent.createChooser(fileIntent,"Openfileusing..."));我不想启动选定的应用程序-我只想知道它是哪一个?谢谢! 最佳答案 不,你无法知道用户选择了什么。但是,您可以使用PackageManager和queryIntentActivities()制

android - JNI 加载 : Warning : Do not hardcode use Context. getFilesDir().getPath() 而不是

我的一个应用程序遇到问题,我有以下代码来加载应用程序需要的库(JNI):static{//loadtheJNIlibraryLog.i("JNI","loadingJNIlibrary...");System.load("/data/data/com.mypackage.appname/lib/libxxxxxx.so");Log.i("JNI","JNIlibraryloaded!");}所以我得到警告:“请注意硬编码使用Context.getFilesDir().getPath()代替”这是完全正确的(它不会在所有设备上都可移植)。问题是,因为我使用的是静态的,所以我无法调用Con

java - 安卓/gradle : not able to use repository

我试图删除我的jar*库并将它们添加为maven-repository-dependencies。看起来很有前途,但我做不到。我用一个库(gson)测试了它,现在我的gradle.build看起来像这样:buildscript{repositories{mavenCentral()}dependencies{classpath'com.android.tools.build:gradle:0.5.+'}}applyplugin:'android'dependencies{compilefileTree(dir:'libs',include:'*.jar')compile'com.goo

android - GoogleJsonResponseException : 404 Not Found using google apps endpoint engine backend

我遵循了下面的教程。https://developers.google.com/eclipse/docs/running_and_debugging_2_0这基本上为我现有的应用程序添加了一个GAE后端。然后我尝试下面的例子,在本地开发服务器上运行它,我得到下面发生在之后的异常Noteresult=endpoint.insertNote(note).execute();被调用。com.google.api.client.googleapis.json.GoogleJsonResponseException:404NotFound我的代码如下。packagecom.cloudnotes;

安卓 "You need to use a Theme.AppCompat theme (or descendant) with the design library"

好的,我收到了这个错误(标题)。许多帖子建议我(甚至是Androidstudio)将主题更改为App.Appcompat,我已经做到了。list文件:样式.xml@color/colorPrimary@color/colorPrimaryDark@color/colorAccentfalsetrue但仍然没有任何改变。我不知道发生了什么,因为我以前没有遇到过这个问题(我之前没有在list文件中添加App.compat)Gradle:compile'com.android.support:appcompat-v7:24.0.0-beta1'compile'com.android.supp

Android 牛轧糖 USE_FINGERPRINT 权限

我正在尝试实现指纹,但不确定这是否是一个问题,但在AndroidNougat上,从未询问过USE_FINGERPRINT的权限。所以我永远不会弹出对话框。我有ACCESS_FINE_LOCATION的实现并且它有效(应用程序要求允许或拒绝)。在我的list中:fragment中if(ActivityCompat.checkSelfPermission(getActivity(),Manifest.permission.USE_FINGERPRINT)!=PackageManager.PERMISSION_GRANTED){Log.v(TAG,"NOpermissionsUSE_FING

android - "You need to use a Theme.AppCompat theme (or descendant) with the design library"错误

我每次都收到“您需要将Theme.AppCompat主题(或后代)与设计库一起使用”错误,即使我显然使用的是AppCompat主题(后代主题)也是如此。依赖项:compile'com.android.support:appcompat-v7:23.3.0'compile'com.android.support:design:23.3.0'compile'com.android.support:support-v4:23.3.0'布局:主题:true@android:color/transparent@nulltruetruefalselist:(...)我在服务中膨胀布局:toolti

android - 如何解决 "Warning: debug info can be unavailable. Please close other application using ADB: Restart ADB integration and try again"

我在尝试通过USB连接到外部设备调试Android应用程序时遇到了一个小问题。我不断收到错误消息“警告:调试信息可能不可用。请使用ADB关闭其他应用程序:Monitor、DDMS、Eclipse重新启动ADB集成并重试等待过程:"我试过在任务管理器中停止adb.exe,关闭androidstudio并重新启动,取出电缆并将其放回原处并转到工具=>android取消选中adb集成,然后重新检查它。一切都无济于事 最佳答案 这是ADB连接的问题,因为有时ADB会在您的真实/虚拟设备上缓存死连接,因此端口繁忙,您无法连接到它。最简单的解决

ElasticSearch script查询报错A document doesn‘t have a value for a field! Use doc[<field>].size()==0

ES版本7.6.0想筛选某两个字段之和大于10的文档,需要用到脚本,简化的请求如下{"query":{"bool":{"must":[{"script":{"script":"doc['field'].value>=1"}}]}}}报非法状态异常,其实报错提示大概也讲清楚了,“Adocumentdoesn’thaveavalueforafield!”(有一个文档的字段没有值),不过总觉得指示清楚哪个文档哪个字段不是更友好么;并且也给出了解决方案:用doc[].size()==0检查文档是否缺失字段{"error":{"root_cause":[{"type":"script_exception

mysql 5.7 登录报错:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

索引一、问题详情二、问题解析三、解决方案(root用户的密码错误)方案一:方案二:​一、问题详情输入mysql-uroot-p登录后出现拒绝访问,报错如图:​二、问题解析ERROR1045(28000):Accessdeniedforuser‘root‘@‘localhost‘(usingpassword:YES)译文:错误1045(28000):用户'root'@'localhost'(使用密码)拒绝访问对该报错进行解析,主要有两个方面:Accessdenied提示出现的可能情况:1)mysql的服务器停止:  若MySQL已经没有启动,重启MySQL服务器:  systemctlresta