草庐IT

non-regular

全部标签

java - JNI/安卓 : call to non static method in Java from C++?

我得到了以下当前调用静态Java方法的JNI方法:voidbindToMarketBillingServiceJNI(constchar*inappID){JniMethodInfot;if(JniHelper::getStaticMethodInfo(t,"com/mycompany/games/js/TestsDemo","bindToMarketBillingService","(Ljava/lang/String;)V")){jstringstringArg1;if(!inappID){stringArg1=t.env->NewStringUTF("1");}else{stri

android - 谷歌播放服务 : Finished With Non Zero Exit Value 2

由于我的gradle内部出现问题,我无法让我的程序运行。我最近添加了依赖项:compile'com.google.android.gms:play-services:7.3.0'我的项目。我在我的项目中将它用于map。但是当我运行这个项目时,我得到了这个错误:Information:Gradletasks[:app:assembleDebug]:app:preBuildUP-TO-DATE:app:preDebugBuildUP-TO-DATE:app:compileDebugNdkUP-TO-DATE:app:checkDebugManifest:app:preReleaseBuil

Android gradle 构建错误 "finished with non-zero exit value 42",这是什么意思,我该如何解决?

我正在尝试在我认为是最新版本的androidstudio上运行一个较旧的项目。当我尝试运行或调试应用程序时,我收到2条错误消息。我有谷歌这个,没有找到可行的解决方案。错误1错误:错误:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'E:\AndroidStudio\Android\sdk\build-tools\21.1.2\aapt.exe''以非零退出值42结束错误2错误:任务':app:mergeDebugResour

Android Room 将 Null 作为 Non-Null 类型返回

我有Dao来返回简单的对象。如果对象不存在,Room返回null,但Android应用程序没有崩溃。此外,如果我将该值分配给非空变量,则应用程序不会崩溃。道:@Query("SELECT*FROMusersWHEREidLIKE:idLIMIT1")abstractfungetById(id:Long):User不崩溃的代码:doAsync{valuser:User=userDao.getById(999)//user999notexist,userDaoreturnsnulluiThread{if(user==null){Timber.d("useris$user")//"useri

java - 运行 exec() 时出错。命令 : Working Directory: null Environment: null - how to execute a binary in Android correctly on a non-rooted device?

我想在非root的android设备上运行可执行文件。在java中使用以下命令Runtime.getRuntime().exec("/bin/chmod744/data/data/com.example.myapp/myBin");Runtime.getRuntime().exec("/data/data/com.example.myapp/myBin");结果Errorrunningexec().Command:[/data/data/com.example.myapp/myBin]WorkingDirectory:nullEnvironment:null我发现了很多关于此的问题,但

android - Material 设计 : how to get button text to be regular case (not CAPITAL)?

AndroidMaterialDesign按钮样式将按钮文本设为“大写”字母。我怎样才能取回我通过string.xml提供的任何大小写(非大写,大写)的文本?字符串.xmlAddItem 最佳答案 添加:android:textAllCaps="false" 关于android-Material设计:howtogetbuttontexttoberegularcase(notCAPITAL)?,我们在StackOverflow上找到一个类似的问题: https:

android - error "Process ' command './node_modules/expokit/detach-scripts/run-exp.sh' ' finished with non-zero exit value 1"whie getting android apk file

我有一个带有expokit工具的reactNative项目。现在我想从androidstudio获取一个apk输出文件。但我收到了这个错误:Process'command'./node_modules/expokit/detach-scripts/run-exp.sh''finishedwithnon-zeroexitvalue1如有任何帮助,我们将不胜感激。 最佳答案 运行“exppublish”并重试。希望这会有所帮助:) 关于android-error"Process'comman

Android Span or Non-Breaking Space Causing line break and text duplication (4.0 ICS)

我正在使用多个大量使用span的TextView。问题:有时在我的应用程序中(特别是在IceCreamSandwich上)我会看到文本字符串中没有的换行符以及文本重复。有关示例,请参见下图。请注意第三个句子是如何开始的,然后是换行符,然后文本被复制,句子结束。代码:tv=(TextView)inflater.inflate(R.layout.fragment_reader_list_item,parent,false);SpannableStringBuilderssb=ssbList.get(position);tv.setText(ssb,BufferType.SPANNABLE)

android - 有了 Android 兼容包,为什么要使用 "regular" fragment ?

据我所知,Android兼容包fragment与“常规”蜂窝fragment具有相同的功能。一方面,您拥有适用于1.6到4.0设备的Fragment。另一方面,您的Fragment仅适用于3.1到4.0的设备。Google显然计划在一段时间内维护兼容包。让我选择“常规”而不是ACP的原因是什么?我能找到的唯一原因是尺寸。ACPjar是220ko,但在我看来并没有那么多。这是速度的问题吗?还有什么我想不到的? 最佳答案 FromwhatIhavereadandheard,theAndroidCompatibilityPackageFr

android - 错误 : "Cannot make a static reference to the non-static method findViewById(int) from the type Activity"

我是Java的新手,正在尝试使用EditText创建一个Activity。创建时,它加载当前日期,当用户选择EditText时,它显示一个DatePicker。用户选择日期后,我需要将结果放入EditText。但是,我目前收到以下错误:Cannotmakeastaticreferencetothenon-staticmethodfindViewById(int)fromthetypeActivity我知道我不能对非静态方法进行静态引用。我试图删除所有静态引用,但这给了我其他错误。我的代码如下。您能帮我提供一些示例代码,说明我如何才能完成这项工作吗?错误出在我尝试将结果放入EditTex