草庐IT

that-dont-suck

全部标签

android - 错误 : Error: No resource found that matches the given name: attr 'colorAccent'

我正在学习MaterialDesign,特别是我想使用MaterialDesign自定义我的应用程序,也适用于较旧的Android版本。我正在阅读本指南:https://developer.android.com/training/material/compatibility.html#SupportLib关于调色板,指南说:ToobtainmaterialdesignstylesandcustomizethecolorpalettewiththeAndroidv7SupportLibrary,applyoneoftheTheme.AppCompatthemes:@color/mate

android - 由 PackageManager.DONT_KILL_APP 引起的不可预测的行为

PackageManager.DONT_KILL_APP的API文档说:Becarefulwhenyousetthissincechangingcomponentstatescanmakethecontainingapplication'sbehaviorunpredictable.不幸的是,他们没有详细说明不可预测行为的含义。在我的应用程序中,我正在切换Activity的启用状态。首先,一个服务启用Activity并启动它:getPackageManager().setComponentEnabledSetting(newComponentName(MyService.this.ge

Android Studio渲染异常: "mBaselineAlignedChildIndex of LinearLayout points to a View that doesn' t know how to get its baseline"

AndroidStudio中出现此设计View错误的原因是什么?渲染期间出现异常:LinearLayout的mBaselineAlignedChildIndex指向不知道如何获取其基线的View。布局如下: 最佳答案 刚遇到同样的错误。基线对齐与确定每个子项的基线的父LinearLayout有关,特别是布局中的最后一个子项。我的问题涉及TimePicker-在API21+中,它是一个图形时钟,因此没有提供基线信息的TextView。这里,问题出在第27-35行:您在Button周围的内部LinearLayout上缺少“android

安卓 Espresso : How to check that Toast message is NOT shown?

我现在正在进行我的功能测试,在其中一个测试中,我必须测试未显示toast消息。考虑到这是我用来检查是否显示toast消息的代码(此代码有效):onView(withText(R.string.my_toast_message)).inRoot(withDecorView(not(getActivity().getWindow().getDecorView()))).check(matches(isDisplayed()));您可以在下面找到我用来检查是否未显示toast消息的代码(它们都不起作用):方法一:onView(withText(R.string.error_invalid_l

java - IntelliJ/结构搜索 : Remove useless methods that only call super method

在我的一个Android项目(但不一定与Android绑定(bind))中,我有很多方法调用实际上什么都不做,只是破坏了代码并且可以自动删除。示例:@OverridepublicbooleanonKeyDown(intkeyCode,KeyEventevent){returnsuper.onKeyDown(keyCode,event);}@OverridepublicbooleanonCreateOptionsMenu(Menumenu){returnsuper.onCreateOptionsMenu(menu);}@OverridepublicvoidonDestroy(){supe

android - Espresso : How can I test that the activity finished with result RESULT_OK?

在我的应用程序中,当用户单击“注册”按钮时,将启动RegisterActivity。用户填写表单后,详细信息将发布到Web服务,如果注册成功,RegisterActivity将以RESULT_OK结束。下面的代码示例总结了这一点:publicvoidsubmitRegistration(){showProgressDialog(R.string.registration,R.string.please_wait);getWebApi().register(buildRegistrationFromUI(),newCallback(){@Overridepublicvoidsuccess

安卓 Espresso : How do I assert that a view should not be displayed

这似乎是正确的...onView(withId(R.id.menu_delete)).check(matches(not(isDisplayed())));...但是它抛出这个异常:android.support.test.espresso.NoMatchingViewException:Noviewsinhierarchyfoundmatching:withid:com.just10.android:id/menu_deleteIfthetargetviewisnotpartoftheviewhierarchy,youmayneedtouseEspresso.onDatatoload

android - 错误 : No resource found that matches the given name (at 'theme' with value '@style/AppTheme' )

![给我错误:(]我什么都试过了......[2014-11-1517:56:06-LoginActivity]C:\Users\Different\workspace\LoginActivity\AndroidManifest.xml:15:error:Error:Noresourcefoundthatmatchesthegivenname(at'theme'withvalue'@style/AppTheme').[2014-11-1517:56:06-LoginActivity][2014-11-1517:56:07-LoginActivity]C:\Users\Different

android - java.lang.RuntimeException : Can't create handler inside thread that has not called Looper. 准备()

嗨,我的代码有问题..我的代码是progressD=ProgressDialog.show(MenuUtama.this,"","Uploadingfilestoserver.....",false);Threadthread=newThread(newRunnable(){publicvoidrun(){//doFileUpload();try{//setiapparameteryangakandikirimmelaluihttp//harusencodeagar//dapatterbacadenganbaikolehserverCursorc=helper.getAll1(alma

android - "No resource found that matches the given name"错误,即使名称匹配

我正在构建一个简单的待办事项列表应用程序。我试图通过相对于彼此定位它们来组织我的布局。我通过调用像android:layout_toStartOf="@id/to_do_btn"这样的XML属性来做到这一点,但是我得到了一个NoResourceFoundThatMatchesTheGivenName错误。我基本上尝试了Stackoverflow上的所有解决方案,但没有任何帮助。这是我的XML:这是错误的示例:Error:(15,31)Noresourcefoundthatmatchesthegivenname(at'layout_above'withvalue'@id/to_do_bt