Android Studio中一些jar包无法打开

如题,在启动Android Studio之后会出现以下错误

图片说明

    Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in C:/Program Files/Android/Android Studio/lib/idea.jar
    java.io.FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in C:/Program Files/Android/Android Studio/lib/idea.jar
        at com.intellij.util.io.URLUtil.openJarStream(URLUtil.java:101)
        at com.intellij.util.io.URLUtil.openStream(URLUtil.java:62)
        at com.intellij.ide.fileTemplates.impl.UrlUtil.loadText(UrlUtil.java:46)
        at com.intellij.ide.fileTemplates.impl.DefaultTemplate.loadText(DefaultTemplate.java:53)
        at com.intellij.ide.fileTemplates.impl.DefaultTemplate.<init>(DefaultTemplate.java:46)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultsFromRoot(FileTemplatesLoader.java:191)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.loadDefaultTemplates(FileTemplatesLoader.java:151)
        at com.intellij.ide.fileTemplates.impl.FileTemplatesLoader.<init>(FileTemplatesLoader.java:93)
        at com.intellij.ide.fileTemplates.impl.FileTemplateSettings.<init>(FileTemplateSettings.java:49)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)
        at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
        at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:58)
        at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:232)
        at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
        at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:212)
        at org.picocontainer.defaults.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:77)
        at org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:114)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:257)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:217)
        at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
        at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:58)
        at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:232)
        at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:246)
        at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:212)
        at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:46)
        at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:41)
        at com.intellij.ide.fileTemplates.FileTemplateManager.getInstance(FileTemplateManager.java:55)
        at com.intellij.codeInspection.defaultFileTemplateUsage.FileHeaderChecker.checkFileHeader(FileHeaderChecker.java:48)
        at com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection.checkFile(DefaultFileTemplateUsageInspection.java:65)
        at com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool$1.visitFile(AbstractBaseJavaLocalInspectionTool.java:98)
        at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
        at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:81)
        at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:69)
        at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:286)
        at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$1(LocalInspectionsPass.java:254)
        at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:123)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1029)
        at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$0(ApplierCompleter.java:96)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:106)
        at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:91)
        at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

然而我用rar打开 C:/Program Files/Android/Android Studio/lib/idea.jar 这个包时又可以找到这个文件,见下图

图片说明

同样的问题还发生在新建类的时候,会报“This template did not produce a Java class or an interface”的错误,当我打开File→Settings→Editor→File and Code Templates→的时候会发现所有的模版都是空的

图片说明

而这个时候关闭设置窗口,又会报“ FileNotFoundException: Entry fileTemplates//default.html not found in C:/Program Files/Android/Android Studio/lib/resources(下划线)en.jar”的错误。而当我用rar打开对应的文件的时候也能找到这个default.html

请求各位大神解决一下,谢谢!

11个回答

谷歌翻墙后终于找到了这个问题的解决方法
首先,这个问题的出现原因就是系统是32位的,却装了64位IDE,虽然网上一直说Android Studio不分64和32
解决方法如下
1.uninstall Android Studio(不卸载SDK)
2.然后到https://developer.android.google.cn/studio/index.html下载32位的压缩包,解压到原来的目录下
3.重新打开android studio,加载成功!

w1063042587
「已注销」 回复weixin_40171106: 如果你看到的是在StackOverFlow上面的问题那么那个很可能是我以前问的ヾ( ̄▽ ̄)
2 年多之前 回复
w1063042587
「已注销」 回复weixin_40171106: 谢谢,问题解决了
2 年多之前 回复
weixin_40171106
weixin_40171106 我的系统是32位的,所以64位的也是同理吧,主要就是系统版本不对了,那个集合了SDK的安装包是为64的电脑准备的
接近 3 年之前 回复

这样做就可以了
修改studio.exe.vmoptions和studio64.exe.vmoptions
-Djdk.util.zip.ensureTrailingSlash=false

m0_37800300
ray118 亲测有效 应该是最简单的办法了吧 感动哭了
大约一年之前 回复
lol_baizhi
lol_baizhi 登录只为你点赞,在android-studio\bin目录下找到studio.exe.vmoptions和studio64.exe.vmoptions文件,在最后添加-Djdk.util.zip.ensureTrailingSlash=false,但这是什么原因
一年多之前 回复
qq_32119771
qq_32119771 问题解决了,直接复制到文件最后,保存后重启AS就搞定了
接近 2 年之前 回复
pengpeng_xin
pengpeng_xin 这两个文件里面没有这一条。。。怎么办?
大约 2 年之前 回复
viliyer
费瑟 你好,这个要具体怎么修改
大约 2 年之前 回复

我是这样解决的:我的系统是win7 64位操作系统,但是由于我之前安装的JDK版本是32位的,所以我在运行android studio的时候选择运行的是32位版本,后来我发现android studio是自带JDK的,所以跟之前安装的32位和64位没啥关系,我运行android studio 64位的就正常了,楼主的系统如果是64位的,尝试一下运行64位的试试,默认的JDK就选AS自带的,或者自己安装的64位JDK

w1063042587
「已注销」 谢谢,问题就出在IDE的版本和操作系统不对应
2 年多之前 回复

已经找到了解决的方法:更新软件到3.0
下载地址:http://www.android-studio.org/
其他都不用卸载,运行3.0后,会提示你更新,更新就可以了.

我也遇到这个问题,不过我是通过更新NDK来解决的

兄弟,你解决了吗?我也遇到这个问题,重装都不好使,就是找不到。。

w1063042587
「已注销」 还有就是升级3.0也可能解决问题
2 年多之前 回复
w1063042587
「已注销」 而且你在AS官网上面下载的时候默认是64位的
2 年多之前 回复
w1063042587
「已注销」 系统版本问题,可能你下载的AS是64位的但是你的操作系统却是32位的
2 年多之前 回复

遇到同样的问题 很尴尬

w1063042587
「已注销」 你可以在http://www.android-studio.org/index.php/download/hisversion下载32位或者64位的IDE重装来解决,问题出在操作系统和IDE的版本(32/64)不对应
2 年多之前 回复

有没有解决方法!!?

w1063042587
「已注销」 你可以在http://www.android-studio.org/index.php/download/hisversion下载32位或者64位的IDE重装来解决,问题出在操作系统和IDE的版本(32/64)不对应
2 年多之前 回复

同样遇到了这个问题!!求问是怎么解决的??

w1063042587
「已注销」 你可以在http://www.android-studio.org/index.php/download/hisversion下载32位或者64位的IDE重装来解决,问题出在操作系统和IDE的版本(32/64)不对应
2 年多之前 回复

确实有点坑人,这个谷歌,很无语.重装了还是依旧.

w1063042587
「已注销」 你可以在http://www.android-studio.org/index.php/download/hisversion下载32位或者64位的IDE重装来解决,问题出在操作系统和IDE的版本(32/64)不对应
2 年多之前 回复
共11条数据 1 尾页
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Android Studio导入jar包后程序无法运行

今天给项目导入了jar包,手滑放到了java文件所在的文件夹,后来删掉并且放到了libs目录下,但是运行程序的时候出现了Error:Execution failed for task ':app:compileDebugJavaWithJavac'.> Failed to create MD5 hash for file 'D:\androidwork\Tbc\app\src\main\java\com\example\tbc\mysql-connector-java-5.0-nightly-20071116-bin.jar 的错误无法运行,可我那个目录下的jar包已经删掉了啊,求帮助T T ![图片说明](https://img-ask.csdn.net/upload/201703/31/1490970910_86051.png)

android studio 里如何指定打包的源文件

类似eclipse里的order and export菜单可以指定哪些文件可以被打进APK内,as里好像没发现这样的功能,有谁知道吗

jar包中class文件中的代码与java 源文件代码不一致

使用 android studio 将java代码 生成.jar 包,通过 android studio 打开jar包,发现其中的class 文件中的代码与java 源文件代码不一致,而且class 文件中的代码有问题 ``` java 代码: public synchronized boolean Deserialize(String data) { int MaxSlots; int MaxChunksPerSlot; int ChunkSize; int TotalSize; if (null == data) return false; if (data.isEmpty()) { destroy(); return true; } String[] arrayData = data.split(" "); int arrdatalen = arrayData.length; if (arrdatalen < 5) return false; _** int idex = 0;**_ try { ChunkSize = Integer.parseInt(arrayData[idex++]); MaxSlots = Integer.parseInt(arrayData[idex++]); MaxChunksPerSlot = Integer.parseInt(arrayData[idex++]); TotalSize = Integer.parseInt(arrayData[idex++]); } catch (NumberFormatException e) { e.printStackTrace(); return false; } if(!(MaxSlots < 10000 && MaxChunksPerSlot < 10000 && ChunkSize < 10000)) return false; if (TotalSize > MaxSlots * MaxChunksPerSlot * ChunkSize) return false; destroy(); m_MaxSlots = MaxSlots; m_MaxChunksPerSlot = MaxChunksPerSlot; m_ChunkSize = ChunkSize; count = TotalSize; buf = new byte[count]; int opindex = 0; while (idex < arrdatalen) { int chunk_id = Integer.parseInt(arrayData[idex++]); int base64_size = Integer.parseInt(arrayData[idex++]); byte[] pBuffer = new byte[ChunkSize]; int ret = Util.Base64_Decode(arrayData[idex++], base64_size, pBuffer, ChunkSize); if (ret < 0) return false; if (ret + opindex <= count) System.arraycopy(pBuffer, 0, this.buf, opindex, ret); opindex += ret; data += base64_size; } return true; } //.class 文件代码 public synchronized boolean Deserialize(String data) { if (null == data) { return false; } else if (data.isEmpty()) { this.destroy(); return true; } else { String[] arrayData = data.split(" "); int arrdatalen = arrayData.length; if (arrdatalen < 5) { return false; } else { **byte idex = 0;** int MaxSlots; int MaxChunksPerSlot; int ChunkSize; int TotalSize; _**int idex;**_ try { **_idex = idex + 1;_** ChunkSize = Integer.parseInt(arrayData[idex]); MaxSlots = Integer.parseInt(arrayData[idex++]); MaxChunksPerSlot = Integer.parseInt(arrayData[idex++]); TotalSize = Integer.parseInt(arrayData[idex++]); } catch (NumberFormatException var14) { var14.printStackTrace(); return false; } if (MaxSlots < 10000 && MaxChunksPerSlot < 10000 && ChunkSize < 10000) { if (TotalSize > MaxSlots * MaxChunksPerSlot * ChunkSize) { return false; } else { this.destroy(); this.m_MaxSlots = MaxSlots; this.m_MaxChunksPerSlot = MaxChunksPerSlot; this.m_ChunkSize = ChunkSize; this.count = TotalSize; this.buf = new byte[this.count]; int base64_size; for(int opindex = 0; idex < arrdatalen; data = data + base64_size) { Integer.parseInt(arrayData[idex++]); base64_size = Integer.parseInt(arrayData[idex++]); byte[] pBuffer = new byte[ChunkSize]; int ret = Util.Base64_Decode(arrayData[idex++], base64_size, pBuffer, ChunkSize); if (ret < 0) { return false; } if (ret + opindex <= this.count) { System.arraycopy(pBuffer, 0, this.buf, opindex, ret); } opindex += ret; } return true; } } else { return false; } } } } ```

如何使用android studio将指定文件编译到apk中

我现在有一些文件需要编译到apk中,但是不知道如何操作 这个是我需要编译到apk中的文件: ![这个是我需要编译到apk中的文件](https://img-ask.csdn.net/upload/201708/29/1503990358_889265.png) 我希望最终达成的效果: ![我希望最终达成的效果](https://img-ask.csdn.net/upload/201708/29/1503990495_434378.png) 我所使用的android stduio的版本为2.3.3,gradle版本为2.2.3。 我的 build.gradle文件 ``` apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "lnsoft.mobile.xtyth" minSdkVersion 21 targetSdkVersion 25 versionCode 4 versionName "1.06" //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" // multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // sourceSets{ // main{ // jniLibs.srcDirs=['libs'] // } // } aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) testCompile 'junit:junit:4.12' compile 'com.android.support:cardview-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.android.support:recyclerview-v7:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1' compile 'org.litepal.android:core:1.6.0' compile 'com.alibaba:fastjson:1.1.62.android' compile project(path: ':commondialogutils_green') compile project(':Android_Validator_master') compile project(':pulltorefreshview') compile project(':changeskin') // compile 'com.android.support:multidex:1.0.1' } ``` 我该如何操作?

androidstudio如何看源代码

android studio 中看Java源代码只能看到空方法而看不到方法中的代码

android studio同步时出现这样的问题!!!

小白提问 Android studio在sync时出现了问题不知道怎么解决了…… ![图片说明](https://img-ask.csdn.net/upload/201903/09/1552096280_869241.png) 如图 求大神帮忙解决下!

Android studio 2.3分渠道打包,统计安装量,获取IMEI错误

由于要统计各个渠道的安装量,用Android studio分渠道打包,生成的apk,安装完成未打开,我们的后台统计已经统计到了安装次数,但获取的IMEI是错误的(还可能会出现多次),然后我在手动打开APP,这时统计到的才是正确的。SDK版本25,求教!

android studio File类无法使用

android studio2.0导入xstream.jar后发现无法使用File类了,是什么原因?

用android studio打包apk的问题

以下是错误信息: Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Luk/co/senab/photoview/Compat Error:Execution failed for task ':app:transformClassesWithDexForRelease'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --output G:\Moneyexchange\app\build\intermediates\transforms\dex\release\folders\1000\1f\main G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_bc6fa630cf13dddbc9e72dd7f3aba2b9cd51d7a1.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\release_0cca68bc8cb9d2fc3e49bd2c61f15ee040b475f8.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\glide-3.7.0_1f3ddf859a86296da03fddcf50d19f29d652df81.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_4999f27ee2bccba3b1d9ca5f4497f67ffbe3d09a.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_59540dd109f7329c044a68a4720ee3860939e47f.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\retrofit-2.1.0_02cdaa5f093e78b272a8b951b62057cb62740b8d.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_91999f92a385be9ea4eb4f7056ca21f7cea3f1f4.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_7cbda6d9011541522ed9c25cade1a6e35e1f8216.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_f14af4277bf1e33d004dd3cffe72b870204d261c.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\uk-co-senab-photoview_98f39f1e63a5baefe6cbe822023d74f2836ccdd4.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_42f1ee2cee217c2a6a4a7ef432060749358c0595.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_afaf65d3e0062bca037b2d284d1ded8cbdd20c10.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\hamcrest-core-1.3_2323b0689b69c651dc52b5f9e0fa5ab289cff959.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\converter-gson-2.1.0_fc6d109c83c05cddded4b5ea732ed5dd7c938086.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\constraint-layout-solver-1.0.2_9ac81d20d17128e2cd1f8d4b8a0fd34ba1a69f7a.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_b3599440e96d81bffd4a0b4432c76b5e566a72fe.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_4830dc9cde2e687b9d91c2839f2be408fc061874.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\support-annotations-25.2.0_4a4b5b43289d807864a8e4b06667a45b4b3adad5.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\rxjava-2.0.1_88fc17d5d72694fd01b893bb935156af845d463f.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_55830afe7dce9536e371ce91113003ae0257fbfc.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_6967c9d3f14fe6fadcc73d1abeca900f5587d82f.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_b04a997ea4eeb88401d7f9b848b3b7778153c1c2.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\gson-2.7_2e85dbf641c4a16c73925139bd4ff50ebb0450dd.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\adapter-rxjava-2.1.0_a922f2c9139fd2cbbf2500b5aa528f1e500fa2f5.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\okhttp-3.4.1_a3a718343956c6e4d917a53a4fdd4a4dc134cda5.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_9855afad2144bd12782bd4f5c6715570685d00de.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\okio-1.9.0_db0545b090bbd931e1cf6e43202e038727277a7d.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_f45acf7bcee5c1c1b647a70fc8d4cd01f67d1800.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\uk-co-senab-photoview-source_5da69885659484faae31ae68650f0e8cdabf5900.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\reactive-streams-1.0.0_5ea215fafe26757b3eaa9e791da078c680959e41.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\rxjava-1.1.9_82a537d5fc11c5aeb9cc44855ce7783630bf9cf4.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\junit-4.12_bca4fc0211375ff0eb614e87bd80b4259fbed036.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\logging-interceptor-3.3.0_b3fde2cef71a54923fc8d0c35792bb7349dfd7bc.jar G:\Moneyexchange\app\build\intermediates\pre-dexed\release\classes_1007fe0210273a76163dfff3deb903130a93f30a.jar}

Android studio运行程序白屏,程序没问题的,怎么回事?

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".activity.SplashActivity"> <ImageView android:id="@+id/img_splash" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:src="@drawable/splash" /> </FrameLayout>

Android studio无法运行项目,连新建的项目都无法运行

不知怎么的,Android Studio就不能运行了,运行新建的空的项目和已经存在的项目都会报下面这个错: ``` Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1 ``` 以下是我工程里的build gredle 文件的内容: ``` apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.0 rc3" defaultConfig { applicationId "com.learnmethod.ericalin.myapplication" minSdkVersion 'MNC' targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) } ``` Android Studio的版本是 1.2.2; 操作系统是 OS X Yosemite 版本 10.5.5; 牛们能帮我看看怎么回事么?不胜感激~~~~

android studio 如何使用github上下载下来的开源库

android studio 如何使用github上下载下来的开源库 比如 koral--/android-gif-drawable 应该怎么做?

android studio安装出现

'tools.jar' seems to be not in null classpath. Please ensure JAVA_HOME points to JDK rather than JRE.

android studio 查看sdk代码大量提示错误

这里是查看 Activity 类的源码,没改过,旁边滚动条上可以看到很多错误的红线 [图片说明](https://img-ask.csdn.net/upload/201610/16/1476612883_78770.png) 不只这个类这样,几乎所有的类都这样,eclipse就不会...求...

android studio 混淆后,打包报错!!!

`` > Exception while processing task java.io.IOException: The same input jar [E:\Work\gv\app\libs\open_sdk_r5509.jar] is specified twice. > at proguard.ConfigurationChecker.checkConflicts(ConfigurationChecker.java:216) > at proguard.ConfigurationChecker.check(ConfigurationChecker.java:83) > at proguard.ProGuard.execute(ProGuard.java:73) > at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074) > at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139) at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115) > at com.android.builder.tasks.Job.runTask(Job.java:48) > at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) > at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227) > at java.lang.Thread.run(Thread.java:745) > :app:dexAnzhiRelease UP-TO-DATE > :app:validateReleaseSigning > :app:packageAnzhiRelease FAILED > FAILURE: Build failed with an exception. > * What went wrong: > Execution failed for task ':app:packageAnzhiRelease'. > Unable to compute hash of E:\Work\gv\app\build\intermediates\classes-proguard\anzhi\release\classes.jar * Try: > Run with --stacktrace option to get the stack trace. Run with --info or --debug > option to get more log output. > BUILD FAILED > Total time: 18.962 secs ` > ``` 请大神指导,小弟在线求。刚才在网上学习了混淆技巧,把混淆模板复制过去,然后打包报错。

android studio做了个APP,其它用了JSOUP,碰到dopostback函数,无法加载

HfztbAcitivity package linpeng.ztb; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import android.app.Activity; import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.opengl.Visibility; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.RotateAnimation; import android.view.animation.ScaleAnimation; import android.view.animation.TranslateAnimation; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.GridView; import android.widget.HorizontalScrollView; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.SimpleAdapter; import android.widget.TextView; import android.widget.Toast; public class HfztbActivity extends Activity implements OnClickListener { private GridView xml_gridview; private ListView xml_newslist; private Button foot_loadmore, prepare_refresh, gotoright, up, down, gotoother, gotoother2, gotoother3, gotoother4, gotoother5; private TextView foot_text; private ProgressBar foot_progressbar; private HorizontalScrollView horizontalScrollView; private SimpleAdapter listview_adapter; private ProgressBar refresh; private String list_button = "title1"; private int changenewslist = 1; private int[][] location = new int[5][2]; private boolean fist_open_title1 = true, fist_open_title2 = true, fist_open_title3 = true, fist_open_title4 = true, fist_open_title5 = true, goto_other_visiably = false;//fist_open_title6 = true, //fist_open_title7 = true, private boolean is_first_open = true; private final int FLINGDIS = 900; private List<Map<String, Object>> newslist = new ArrayList<Map<String, Object>>(); private List<Map<String, Object>> tempnewslist = new ArrayList<Map<String, Object>>(); private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { if (msg.arg1 > -1) { prepare_refresh.setVisibility(0); refresh.setVisibility(8); Log.i("list_button", new IntToStrong().getname(msg.arg1) + list_button); changeFirstOpen(msg.arg1); if (list_button.equals(new IntToStrong().getname(msg.arg1))) { getNewsList(msg.arg1, false); } } if (msg.arg1 == -1) { prepare_refresh.setVisibility(0); refresh.setVisibility(8); Toast.makeText(HfztbActivity.this, "网络不通,请稍候再试", Toast.LENGTH_SHORT).show(); } } private void changeFirstOpen(int arg1) { if (arg1 == 0 && fist_open_title1) { fist_open_title1 = false; } else if (arg1 == 1 && fist_open_title2) { fist_open_title2 = false; } else if (arg1 == 2 && fist_open_title3) { fist_open_title3 = false; } else if (arg1 == 3 && fist_open_title4) { fist_open_title4 = false; } else if (arg1 == 4 && fist_open_title5) { fist_open_title5 = false; // } else if (arg1 == 5 && fist_open_title6) { // fist_open_title6 = false; // } else if (arg1 == 6 && fist_open_title7) { // fist_open_title7 = false; } } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); xml_gridview = (GridView) findViewById(R.id.xml_gridview); xml_gridview.setSelector(new ColorDrawable(Color.TRANSPARENT)); xml_newslist = (ListView) findViewById(R.id.newslist); prepare_refresh = (Button) findViewById(R.id.prepare_refresh); refresh = (ProgressBar) findViewById(R.id.refresh); gotoright = (Button) findViewById(R.id.gotoright); horizontalScrollView = (HorizontalScrollView) findViewById(R.id.horizontalScrollView); up = (Button) findViewById(R.id.up); down = (Button) findViewById(R.id.down); gotoother = (Button) findViewById(R.id.gotoother); gotoother2 = (Button) findViewById(R.id.gotoother2); gotoother3 = (Button) findViewById(R.id.gotoother3); gotoother4 = (Button) findViewById(R.id.gotoother4); gotoother5 = (Button) findViewById(R.id.gotoother5); LayoutInflater layoutInflater = getLayoutInflater(); View footView = layoutInflater.inflate(R.layout.foot, null); xml_newslist.addFooterView(footView); foot_loadmore = (Button) findViewById(R.id.foot_loadmore); foot_text = (TextView) findViewById(R.id.foot_text); foot_progressbar = (ProgressBar) findViewById(R.id.foot_progressbar); foot_loadmore.setOnClickListener(this); prepare_refresh.setOnClickListener(this); gotoright.setOnClickListener(this); up.setOnClickListener(this); down.setOnClickListener(this); gotoother.setOnClickListener(this); gotoother2.setOnClickListener(this); gotoother3.setOnClickListener(this); gotoother4.setOnClickListener(this); gotoother5.setOnClickListener(this); getNewsList(0, false); SimpleAdapter gridview_adapter = new SimpleAdapter(this, new ListData().getGridviewdata(), R.layout.gridview, new String[] { "grid_title" }, new int[] { R.id.grid_title }); listview_adapter = new SimpleAdapter(this, newslist, R.layout.newslistdetails, new String[] { "news_isend", "news_title", "news_time" }, new int[] { R.id.news_isend, R.id.news_title, R.id.news_time }); is_first_open = false; xml_gridview.setAdapter(gridview_adapter); xml_gridview.setOnItemClickListener(new onGridViewItemClick()); xml_newslist.setOnItemClickListener(new onListViewItemClick()); xml_newslist.setAdapter(listview_adapter); } private void getloction() { gotoother.getLocationOnScreen(location[0]); gotoother2.getLocationOnScreen(location[1]); gotoother3.getLocationOnScreen(location[2]); gotoother4.getLocationOnScreen(location[3]); gotoother5.getLocationOnScreen(location[4]); Log.i("x", location[0][0] + " " + location[0][1]); } private void getNewsList(int table_number, boolean is_fresh) { boolean has_fresh = false; String table_name = new IntToStrong().getname(table_number); DataBaseHelper dbh = new DataBaseHelper(this, table_name, null, 1); SQLiteDatabase sql = dbh.getReadableDatabase(); Cursor cursor = sql.query(table_name, new String[] { "newsclass", "newstitle", "newstime", "isread" }, "newsclass>?", new String[] { "-1" }, null, null, null); if (cursor.getCount() != 0 && is_fresh == false) { newslist.clear(); getNewsListByDatabase(cursor); prepare_refresh.setVisibility(0); refresh.setVisibility(8); if (!is_first_open) { listview_adapter.notifyDataSetChanged(); xml_newslist.setSelection(0); list_button = new IntToStrong().getname(table_number); } } else { list_button = new IntToStrong().getname(table_number); MyThread myThread = new MyThread(table_number, HfztbActivity.this); has_fresh = true; myThread.start(); } if (!has_fresh) { reFresh(table_name, table_number); } if (sql != null) { sql.close(); } if (dbh != null) { dbh.close(); } } private void reFresh(String table_name, int table_number) { if (fist_open_title1 && table_name == "title1") { MyThread myThread = new MyThread(table_number, HfztbActivity.this); myThread.start(); } else if (fist_open_title2 && table_name == "title2") { MyThread myThread = new MyThread(table_number, HfztbActivity.this); myThread.start(); } else if (fist_open_title3 && table_name == "title3") { MyThread myThread = new MyThread(table_number, HfztbActivity.this); myThread.start(); } else if (fist_open_title4 && table_name == "title4") { MyThread myThread = new MyThread(table_number, HfztbActivity.this); myThread.start(); } else if (fist_open_title5 && table_name == "title5") { MyThread myThread = new MyThread(table_number, HfztbActivity.this); myThread.start(); //} else if (fist_open_title6 && table_name == "title6") { // MyThread myThread = new MyThread(table_number, HfztbActivity.this); // myThread.start(); //} else if (fist_open_title7 && table_name == "title7") { // MyThread myThread = new MyThread(table_number, HfztbActivity.this); // myThread.start(); } } private void getNewsListByDatabase(Cursor cursor) { newslist.clear(); while (cursor.moveToNext()) { Map<String, Object> map = new HashMap<String, Object>(); map.put("news_title", cursor.getString(cursor.getColumnIndex("newstitle"))); map.put("news_time", cursor.getString(cursor.getColumnIndex("newstime"))); map.put("news_isend", cursor.getString(cursor.getColumnIndex("isread"))); newslist.add(map); } } class onGridViewItemClick implements OnItemClickListener { public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { int table_number = arg2; TextView gridviewback = (TextView) arg1; for (int i = 0; i < arg0.getCount(); i++) { TextView gridview_text_temp = (TextView) arg0.getChildAt(i); gridview_text_temp.setBackgroundDrawable(null); gridview_text_temp.setTextColor(getResources().getColor( R.color.grid_title_color)); } gridviewback.setBackgroundResource(R.drawable.gridviewbackground); gridviewback.setTextColor(Color.WHITE); if (arg2 >= 0 && arg2 <= 6) { getNewsList(table_number, false); Log.i("after", "thread"); } } } class onListViewItemClick implements OnItemClickListener { public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { DataBaseHelper dbh = new DataBaseHelper(HfztbActivity.this, list_button, null, 1); SQLiteDatabase sq = dbh.getReadableDatabase(); Cursor cursor = sq.query(list_button, new String[] { "newsclass", "newstitle", "newstime", "isread", "url" }, "newsclass=?", new String[] { arg2 + "" }, null, null, null); cursor.moveToNext(); Intent intent = new Intent(HfztbActivity.this, News.class);// ��ת������ҳ if (!cursor.isAfterLast()) { intent.putExtra("newsurl", cursor.getString(cursor.getColumnIndex("url"))); intent.putExtra("newstitle", cursor.getString(cursor.getColumnIndex("newstitle"))); intent.putExtra("newstime", cursor.getString(cursor.getColumnIndex("newstime"))); intent.putExtra("type", list_button); startActivity(intent); } if (dbh != null) { dbh.close(); sq.close(); } } } public class MyThread extends Thread { private int table_number; private Context context; public MyThread(int table_number, Context context) { this.table_number = table_number; this.context = context; } @Override public void run() { getNewsList(table_number); } protected void getNewsList(int table_number) { try { Document doc; String url = "http://ggzy.jiangxi.gov.cn/jxzbw/jyxx/002004/00200400" + (table_number + 1) + "/MoreInfo.aspx?CategoryNum=00200400"+ (table_number + 1); doc = Jsoup.connect(url).get(); new ListData().getListData(doc, table_number, context, url); Message msg = handler.obtainMessage(); msg.arg1 = table_number; handler.sendMessage(msg); } catch (IOException e) { Log.i("tag", "error"); Message msg = handler.obtainMessage(); msg.arg1 = -1; handler.sendMessage(msg); e.printStackTrace(); } } } public void onClick(View v) { if (v.getId() == foot_loadmore.getId()) { foot_loadmore.setVisibility(8); foot_text.setVisibility(0); foot_progressbar.setVisibility(0); } if (v.getId() == prepare_refresh.getId()) { prepare_refresh.setVisibility(8); refresh.setVisibility(0); getNewsList(new IntToStrong().table_name_to_int(list_button), true); } if (v.getId() == gotoright.getId()) { horizontalScrollView.fling(FLINGDIS); Log.i("" + horizontalScrollView.getScrollY(), horizontalScrollView.getScrollX() + ""); } if (v.getId() == up.getId()) { xml_newslist.setSelection(0); } if (v.getId() == down.getId()) { Log.i("asff", xml_newslist.getScrollY() + ""); xml_newslist.setSelection(1000); } if (v.getId() == gotoother.getId()) { getloction(); if (!goto_other_visiably) { setVisiablyAndAnimation(false, -1); } else { Log.i("x", location[0][0] + " " + location[0][1]); setVisiablyAndAnimation(true, 0); } } if (v.getId() == gotoother2.getId()) { setVisiablyAndAnimation(false, 0); } if (v.getId() == gotoother3.getId()) { setVisiablyAndAnimation(false, 1); } if (v.getId() == gotoother4.getId()) { setVisiablyAndAnimation(false, 2); } if (v.getId() == gotoother5.getId()) { setVisiablyAndAnimation(false, 3); } } private void setVisiablyAndAnimation(boolean b, int which) { if (!b && which > -1) { ScaleAnimation[] scaleAnimations = getScaleAnimation(which); gotoother2.startAnimation(scaleAnimations[0]); gotoother3.startAnimation(scaleAnimations[1]); gotoother4.startAnimation(scaleAnimations[2]); gotoother5.startAnimation(scaleAnimations[3]); gotoother2.setVisibility(8); gotoother3.setVisibility(8); gotoother4.setVisibility(8); gotoother5.setVisibility(8); goto_other_visiably = false; } else if (which == -1) { TranslateAnimation[] translateAnimations = getTranslateAnimation(which); gotoother2.startAnimation(translateAnimations[0]); gotoother3.startAnimation(translateAnimations[1]); gotoother4.startAnimation(translateAnimations[2]); gotoother5.startAnimation(translateAnimations[3]); gotoother2.setVisibility(0); gotoother3.setVisibility(0); gotoother4.setVisibility(0); gotoother5.setVisibility(0); goto_other_visiably = true; } else { TranslateAnimation[] translateAnimations = getTranslateAnimation(which); gotoother2.startAnimation(translateAnimations[0]); gotoother3.startAnimation(translateAnimations[1]); gotoother4.startAnimation(translateAnimations[2]); gotoother5.startAnimation(translateAnimations[3]); gotoother2.setVisibility(8); gotoother3.setVisibility(8); gotoother4.setVisibility(8); gotoother5.setVisibility(8); goto_other_visiably = false; } } private TranslateAnimation[] getTranslateAnimation(int which) { TranslateAnimation[] translateAnimations = new TranslateAnimation[4]; if (which == -1) { translateAnimations[0] = new TranslateAnimation(Animation.ABSOLUTE, location[0][0] - location[1][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[1][1], Animation.RELATIVE_TO_SELF, 0f); translateAnimations[1] = new TranslateAnimation(Animation.ABSOLUTE, location[0][0] - location[2][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[2][1], Animation.RELATIVE_TO_SELF, 0f); translateAnimations[2] = new TranslateAnimation(Animation.ABSOLUTE, location[0][0] - location[3][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[3][1], Animation.RELATIVE_TO_SELF, 0f); translateAnimations[3] = new TranslateAnimation(Animation.ABSOLUTE, location[0][0] - location[4][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[4][1], Animation.RELATIVE_TO_SELF, 0f); translateAnimations[0].setDuration(100); translateAnimations[1].setDuration(150); translateAnimations[2].setDuration(200); translateAnimations[3].setDuration(250); } else { translateAnimations[0] = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][0] - location[1][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[1][1]); translateAnimations[1] = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][0] - location[2][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[2][1]); translateAnimations[2] = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][0] - location[3][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[3][1]); translateAnimations[3] = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][0] - location[4][0], Animation.RELATIVE_TO_SELF, 0f, Animation.ABSOLUTE, location[0][1] - location[4][1]); translateAnimations[0].setDuration(250); translateAnimations[1].setDuration(200); translateAnimations[2].setDuration(150); translateAnimations[3].setDuration(100); } return translateAnimations; } private ScaleAnimation[] getScaleAnimation(int which) { ScaleAnimation[] scaleAnimations = new ScaleAnimation[4]; scaleAnimations[0] = new ScaleAnimation(1, 0.1f, 1, 0.1f); scaleAnimations[1] = new ScaleAnimation(1, 0.1f, 1, 0.1f); scaleAnimations[2] = new ScaleAnimation(1, 0.1f, 1, 0.1f); scaleAnimations[3] = new ScaleAnimation(1, 0.1f, 1, 0.1f); scaleAnimations[which] = new ScaleAnimation(1, 1.7f, 1, 1.7f); scaleAnimations[0].setDuration(150); scaleAnimations[1].setDuration(150); scaleAnimations[2].setDuration(150); scaleAnimations[3].setDuration(150); return scaleAnimations; } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { Builder builder = new Builder(this); builder.setMessage("确定退出吗?"); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { System.exit(0); } }); builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); builder.show(); } return true; } } Listdata package linpeng.ztb; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import android.widget.Toast; public class ListData { public List<Map<String, String>> getGridviewdata() { List<Map<String, String>> list = new ArrayList<Map<String, String>>(); HashMap<String, String> hash = new HashMap<String, String>(); hash.put("grid_title", "采购公告"); list.add(hash); hash = new HashMap<String, String>(); hash.put("grid_title", "变更公告"); list.add(hash); hash = new HashMap<String, String>(); hash.put("grid_title", "答疑澄清"); list.add(hash); hash = new HashMap<String, String>(); hash.put("grid_title", "结果公示"); list.add(hash); hash = new HashMap<String, String>(); hash.put("grid_title", "单一来源"); list.add(hash); //hash = new HashMap<String, String>(); //hash.put("grid_title", "标前公示ʾ"); //list.add(hash); //hash = new HashMap<String, String>(); //hash.put("grid_title", "巢湖"); //list.add(hash); return list; } public void getListData(Document doc, int table_number, Context context, String url) { try { Element ele = doc.select("td[height=500]").first(); Elements eles = ele.select("a"); int newsclass = 0; String table_name = new IntToStrong().getname(table_number); if (ele.text().length() > 1) { DataBaseHelper dbh = new DataBaseHelper(context, table_name, null, 1); Log.i("shanchu", "ca"); dbh.dellAll(); } if (table_number != 3 && table_number != 5) { for (Element ele2 : eles) { String inittext = ele2.text(); String isend = "报名结束"; String changetext = inittext.replace("【正在报名】", "");// 替换文中的【正在报名】 String newsurl = ele2.attr("abs:href"); if (changetext.length() != inittext.length()) { isend = "正在报名"; } else { changetext = changetext.replace("【报名结束】", "");// 替换文中的【报名结束】 } if (ele2.text().replace("更多信息", "").length() >= 2) { DataBaseHelper dbh = new DataBaseHelper(context, table_name, null, 1); SQLiteDatabase sqh = dbh.getWritableDatabase(); dbh.addnewslist(newsclass, changetext, ele2.parent() .parent().select("td").last().text(), isend, newsurl); newsclass++; } } } else { for (Element ele2 : eles) { String inittext = ele2.text(); String newsurl = ele2.attr("abs:href"); String name = new IntToStrong().getname(table_number); if (ele2.text().replace("更多信息", "").length() >= 2) { DataBaseHelper dbh = new DataBaseHelper(context, name, null, 1); SQLiteDatabase sqh = dbh.getWritableDatabase(); dbh.addnewslist(newsclass, inittext, ele2.parent() .parent().select("td").last().text(), "", newsurl); newsclass++; } } } } catch (Exception e) { Log.i("s", "网络不通"); // Toast.makeText(context, "网络不通,请稍候再试",Toast.LENGTH_SHORT).show(); } } } NEWS package linpeng.ztb; import java.util.HashMap; import java.util.Map; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import android.R.integer; import android.app.Activity; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.RemoteViews.ActionException; import android.widget.TextView; import android.widget.Toast; public class News extends Activity { private TextView news_details_text, news_details_title, news_details_time; private ProgressBar news_details_progress; private int flag = 1, arg2, text_size;// flag=1表示从网络获取数据=0表示从数据库获取数据 private String kind, url; private String newsdetailstext = "", downloadtext = "", downloadaddress = "", type; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.arg1) { case 1: if (newsdetailstext.length() > 3) { putData(); } else { Toast.makeText(News.this, "网络不通,请稍后再试", Toast.LENGTH_SHORT) .show(); } news_details_text.setText(newsdetailstext); news_details_progress.setVisibility(8); break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.news); Intent intent = getIntent(); SharedPreferences s = getSharedPreferences("text_size", 0); text_size = s.getInt("text_size", 20); url = intent.getStringExtra("newsurl"); type = intent.getStringExtra("type"); String newstitle = intent.getStringExtra("newstitle"); String newstime = intent.getStringExtra("newstime"); news_details_text = (TextView) findViewById(R.id.news_details_text); news_details_title = (TextView) findViewById(R.id.news_details_title); news_details_time = (TextView) findViewById(R.id.news_details_time); news_details_progress = (ProgressBar) findViewById(R.id.news_details_progress); news_details_progress.setVisibility(0); news_details_title.setText(newstitle); news_details_time.setText(newstime); news_details_text.setTextSize(text_size); flag = 0; DataBaseHelper dbh = new DataBaseHelper(this, new IntToStrong().TypeToType(type), null, 1); SQLiteDatabase sql = dbh.getReadableDatabase(); Cursor cursor = sql.query(new IntToStrong().TypeToType(type), new String[] { "newsurl", "newstitle", "newstime", "newsdetails", "newsdownloadtext1", "newsdownloadurl1", "newsdownloadtext2", "newsdownloadurl2" }, "newsurl=?", new String[] { url }, null, null, null); cursor.moveToNext(); if (cursor.getCount() == 0) { new NewsThread().start(); } else { news_details_text.setText(cursor.getString(cursor .getColumnIndex("newsdetails"))); news_details_progress.setVisibility(8); } if (sql != null) { sql.close(); } } protected void putData() { DataBaseHelper dbh = new DataBaseHelper(this, new IntToStrong().TypeToType(type), null, 1); SQLiteDatabase sql = dbh.getWritableDatabase(); dbh.addetails(url, news_details_title.getText().toString(), news_details_time.getText().toString(), newsdetailstext, null, null, null, null); if (dbh != null) { dbh.close(); sql.close(); } } private void getNews() { try { String host = android.net.Proxy.getDefaultHost(); int port = android.net.Proxy.getDefaultPort(); Document doc = Jsoup.connect(url).get(); Element ele = doc.getElementById("TDContent"); int j = 1; if (ele.children().text().length() < 2) { System.out.println(1); newsdetailstext = newsdetailstext + ele.text(); } for (Element ele2 : ele.children()) { j++; newsdetailstext = newsdetailstext + ele2.text(); newsdetailstext = newsdetailstext + "\n"; newsdetailstext = newsdetailstext + "\n"; } if (j == 2) { newsdetailstext = ""; for (Element ele2 : ele.children()) { for (Element ele3 : ele2.children()) { System.out.println(3); newsdetailstext = newsdetailstext + ele3.text(); newsdetailstext = newsdetailstext + "\n"; newsdetailstext = newsdetailstext + "\n"; } } } } catch (Exception e) { e.printStackTrace(); } } private class NewsThread extends Thread { @Override public void run() { getNews(); Message msg = handler.obtainMessage(); msg.arg1 = 1; handler.sendMessage(msg); } } @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(menu.NONE, 1, 1, "字体大小"); menu.add(menu.NONE, 2, 1, "使用浏览器打开此页面"); menu.add(menu.NONE, 3, 1, "拨打此页面中电话"); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 1: Builder builder = new Builder(this); builder.setTitle("字体大小"); builder.setSingleChoiceItems(new String[] { "大", "中", "小" }, new IntToStrong().text_size_to_order(text_size), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { if (which == 0) { news_details_text.setTextSize(24); SharedPreferences sp = getSharedPreferences( "text_size", 0); sp.edit().putInt("text_size", 24).commit(); dialog.cancel(); } else if (which == 1) { news_details_text.setTextSize(20); SharedPreferences sp = getSharedPreferences( "text_size", 0); sp.edit().putInt("text_size", 20).commit(); dialog.cancel(); } else if (which == 2) { news_details_text.setTextSize(16); SharedPreferences sp = getSharedPreferences( "text_size", 0); sp.edit().putInt("text_size", 16).commit(); dialog.cancel(); } } }); builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); builder.show(); break; case 2: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); break; case 3: Builder builder2=new Builder(this); Map telephone=getTelePhone(); //LayoutInflater inflater=getLayoutInflater(); //View layout=inflater.inflate(R.layout.telephone,(ViewGroup)findViewById(R.id.news_tele)); Intent intent1 = new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+ telephone.get("tele"+1))); startActivity(intent1); //builder2.setView(layout); //builder2.show(); break; default: break; } return true; } private Map getTelePhone() { Map telephone = new HashMap<String, String>(); if (news_details_text.length() > 5) { int temp_index_telephone=1; String text = news_details_text.getText().toString(); for (int i = 1; i <= text.length() - 1; i++) { if (text.charAt(i) == '电' && text.charAt(i + 1) == '话' || text.charAt(i) == '电' && text.charAt(i + 2) == '话') { int k = 3; if(text.charAt(i+2)=='话'){ k=4; } String temp_telephone=""; while (text.charAt(i + k) == '1' || text.charAt(i + k) == '2' || text.charAt(i + k) == '3' || text.charAt(i + k) == '4' || text.charAt(i + k) == '5' || text.charAt(i + k) == '6' || text.charAt(i + k) == '7' || text.charAt(i + k) == '8' || text.charAt(i + k) == '9' || text.charAt(i + k) == '-' || text.charAt(i + k) == '0') { temp_telephone=temp_telephone+text.charAt(i+k); k++; } if(temp_telephone.length()>5){ temp_telephone=temp_telephone.replace("-",""); telephone.put("tele"+temp_index_telephone, temp_telephone); Log.i("sasaa", "" + temp_telephone); temp_index_telephone++; temp_telephone=""; } } } } return telephone; } }

android studio怎么查看安卓自带类或方法的实现代码

我按住ctrl加鼠标左键是打开声明,怎么打开类或方法的源码呢

Androidstudio 无法引用自定义的注解处理器 Processor

自定义了注解处理器,用于方法注入 ``` public class MethodJnjectProcessor extends AbstractProcessor ``` 上传到Bintray的个人仓库后,在项目中引用 ``` annotationProcessor "com.knowledge.mnlin:methodinject-compiler:0.0.1" ``` 却提示找不到资源 ``` Could not resolve all files for configuration ':app:debugAnnotationProcessorClasspath'. > Could not find methodinject-compiler.jar (com.knowledge.mnlin:methodinject-compiler:0.0.1). Searched in the following locations: https://dl.bintray.com/lovingning/maven/com/knowledge/mnlin/methodinject-compiler/0.0.1/methodinject-compiler-0.0.1.jar * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ``` 但事实上这个路径在浏览中打开的话,是可以下载到jar包的 ![图片说明](https://img-ask.csdn.net/upload/201712/15/1513348428_256019.png) 所以说,可以看到jar包可以下载成功的,但gradle的错误显示的也很明显,不知道是什么原因 ![图片说明](https://img-ask.csdn.net/upload/201712/15/1513348553_41631.png)

Android studio 导入项目后出现sync failed

我的Android studio在git上面将项目clone下来之后打开,就出现了这个状况,查看C:\Users\Administrator\.gradle\wrapper\dists里的gradle,发现文件夹文件大小为0k。而后我再网页上下载了4.1的zip包放到该文件下,重启studio,发现还是这个样子,再看4.1的文件夹里,文件大小还是0k

如果能重来,我不会选择北漂——初见北京

一个人走的路

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

2020年大厂Java面试前复习的正确姿势(800+面试题答案解析)

前言 个人觉得面试也像是一场全新的征程,失败和胜利都是平常之事。所以,劝各位不要因为面试失败而灰心、 丧失斗志。也不要因为面试通过而沾沾自喜,等待你的将是更美好的未来,继续加油! 本篇分享的面试题内容包括:Java、MyBatis、ZooKeeper、Dubbo、Elasticsearch、Redis、MySQL、Spring、SpringBoot、SpringCloud、RabbitMQ...

抖音上很火的时钟效果

反正,我的抖音没人看,别人都有几十万个赞什么的。 发到CSDN上来,大家交流下~ 主要用到原生态的 JS+CSS3。 具体不解释了,看注释: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/tit...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

又出事了?网站被攻击了?高中生?

北京时间2020年3月27日9点整,如往常一样来到公司,带开电脑,正准备打开Github网站看一会源代码,再开始手头的工作。哟吼,一直打不开,一直出现如下页面: 我想很多网友也尝到了甜头,各大技术群炸开了锅,据网友反馈有攻击者正在发起大规模的中间人挟持,京东和Github等网站等网站都受到了影响。 什么是中间中间人挟持呢? 简而言之,就是攻击者在数据网络传输的过程中,截获传输过程中的数据并篡改...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

我把华为小米年报放一起,发现华为才是真·手机公司,小米确实不靠卖手机赚钱...

郭一璞 发自 凹非寺量子位 报道 | 公众号 QbitAI国产手机界的两大玩家,华为&amp;小米,昨天在同一天前后脚发布了2019年财报。同行冤家,发财报也碰在了同一天。那我们就对比...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

毕业5年,我熬夜整理出了这50个优质的电子书网站,吐血推荐!

大家好,我是武哥,最近经常有小伙伴问我要电子书,都什么年代了,还找不到电子书吗?如果要说原因,那就是你还没遇到武哥我(手动滑稽~)!我今天把这么多年我经常看的电子书网站整理一下给大家,基本上能解决大家的需求。不管是在校生还是已经工作了,相信肯定对你有所帮助! 1.鸠摩搜书 首先给大家推荐的网站是:鸠摩搜书 地址:https://www.jiumodiary.com/ 这个网上非常棒,上面有很多优质...

MySQL性能优化(五):为什么查询速度这么慢

前期回顾: MySQL性能优化(一):MySQL架构与核心问题 MySQL性能优化(二):选择优化的数据类型 MySQL性能优化(三):深入理解索引的这点事 MySQL性能优化(四):如何高效正确的使用索引 前面章节我们介绍了如何选择优化的数据类型、如何高效的使用索引,这些对于高性能的MySQL来说是必不可少的。但这些还完全不够,还需要合理的设计查询。如果查询写的很糟糕,即使表结构再合理、索引再...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

总结了Mybatis,原来知识点也没多少嘛

看完这篇Mybatis,感觉你三天就会用了。

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

疫情后北上广深租房价格跌了吗? | Alfred数据室

去年3月份我们发布了《北上广深租房图鉴》(点击阅读),细数了北上广深租房的各种因素对租房价格的影响。一年过去了,在面临新冠疫情的后续影响、城市尚未完全恢复正常运转、学校还没开学等情况下...

面试官给我挖坑:a[i][j] 和 a[j][i] 有什么区别?

点击上方“朱小厮的博客”,选择“设为星标”后台回复&#34;1024&#34;领取公众号专属资料本文以一个简单的程序开头——数组赋值:int LEN = 10000; int[][] ...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行
立即提问