草庐IT

re-doing-it-wrong

全部标签

android - 内存不足错误 : Using a image which is 1080*1920 do the splash page

这个问题在这里已经有了答案:StrangeOutOfMemoryissuewhileloadinganimagetoaBitmapobject(44个答案)关闭7年前。我想在我的Android应用程序中实现启动页面。所以在布局xml中,有一个imageView,图像文件是一个png文件,是1080*1920,当运行应用程序时,会发生OutOfMemoryError错误,我该如何解决?XML文件:错误信息:04-1718:40:16.03829793-29793/cn.test.androidE/AndroidRuntime﹕FATALEXCEPTION:mainProcess:cn.t

android - 什么是非嵌入式 Activity ,为什么不是 android :fitsSystemWindows work in it?

我试图在View上使用android:fitsSystemWindows属性,这样它就不会被我的半透明导航栏阻挡,但它什么也没做。其上的Android文档说fitsSystemWindows“仅当此View位于非嵌入式Activity中时才会生效。”什么是嵌入式Activity?我有可能不小心创造了一个吗?有没有可能在一个内得到fitsSystemWindows的效果? 最佳答案 嵌入式Activity是托管在父Activity中的Activity。常见示例是TabHost/TabActivity设计。特别是,嵌入式Acitviti

Android Studio 我不断收到 Gradle 错误 "The process cannot access the file because it is being used by another process"

我可以导入示例应用程序项目,尝试构建它,但我一直收到此错误。不总是同一个文件,而是每次都有一个新的临时文件。我试过几种不同的sample。我已经编程30多年了,感觉完全一无所知。唯一的线索似乎是Windows任务管理器在给出错误并结束构建时显示99%到100%的CPU使用率。 最佳答案 这样做文件->无效缓存/重启..->无效/重启 关于AndroidStudio我不断收到Gradle错误"Theprocesscannotaccessthefilebecauseitisbeingused

android - 带有 Android : How do I inject the current context? 的 Dagger

当我使用RoboGuice时,我能够通过构造函数将上下文注入(inject)到我的类中,并且RoboGuice会选择合适的上下文(在Activity中注入(inject)将具有Activity上下文,在Application中注入(inject)将具有当前应用程序上下文,在fragment将具有fragment的Activity上下文等...)。Dagger有类似的方法吗?publicclassThing{@InjectpublicclassThing(Contextcontext){//ifi'minjectedinanActivity,Ishouldbethecurrentacti

android - 数据绑定(bind)不存在 : How to solve it?

我正在开发一个带有数据绑定(bind)的Android应用程序,但我总是遇到下一个错误:Error:Packagemy.package.databindingdoesnotexist.这是我在项目级别的build.gradle:buildscript{repositories{jcenter()}dependencies{classpath'com.android.tools.build:gradle:2.2.2'}}allprojects{repositories{jcenter()}}taskclean(type:Delete){deleterootProject.buildDir

dart - PageView : Disable the default scrolling and replace it with Tap event

如果我有PageView,如何禁用默认滚动行为(滑动)并通过点击按钮将下一个项目滚动到View中? 最佳答案 要禁用滑动,您可以设置:PageView(physics:NeverScrollableScrollPhysics()) 关于dart-PageView:DisablethedefaultscrollingandreplaceitwithTapevent,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

dart - PageView : Disable the default scrolling and replace it with Tap event

如果我有PageView,如何禁用默认滚动行为(滑动)并通过点击按钮将下一个项目滚动到View中? 最佳答案 要禁用滑动,您可以设置:PageView(physics:NeverScrollableScrollPhysics()) 关于dart-PageView:DisablethedefaultscrollingandreplaceitwithTapevent,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

android - 触摸 TextView 时无法滚动 ViewPager(使用 android :gravity ="center") in it

在我的ViewPager中,有一个ImageButton和TextView由LinearLayout控制,现在我将它们更改为一个带有coupounddrawable的TextView。我的问题是:触摸TextView时我无法左右翻转,但如果删除“android:gravity="center”,它会工作...不幸的是,文本无论如何都不居中...publicclassNoScrollTextViewextendsTextView{publicNoScrollTextView(Contextcontext){super(context);}publicNoScrollTextView(Co

android - Espresso : How to do custom swipe e. 克。 swipeTop 或 swipeBottom

到目前为止我们可以做的:向左滑动向右滑动向上轻扫向下滑动我们怎样才能swipeTop(一直到顶部)或swipeBottom(一直到底部)是expresso。如果这些方法已经存在,请给我一个例子。 最佳答案 你试过这样的GeneralSwipeAction吗?privatestaticViewActionswipeFromTopToBottom(){returnnewGeneralSwipeAction(Swipe.FAST,GeneralLocation.TOP_CENTER,GeneralLocation.BOTTOM_CENTE

android - 真的更喜欢网络 : select my own network provider as soon as it is available (from code)

我住在边境附近,在另一个国家工作。所以我选择了自己的网络提供商作为最爱。但是,我注意到它会尽可能长时间地与提供者保持联系。因此,当我从我的国家开始时,即使我跨越国界,我也会保留我的网络,但是,当我从另一个方向出发时,即使我最喜欢的网络已经可用,它也会保留国外网络。我知道这一点,因为当我想手动选择它时,它可以从列表中获得。现在,我想创建一个应用程序,它会在漫游时自动搜索我的首选网络,每次它连接到另一个手机信号塔。现在我明白了,以前我可以用广播接收器改变小区位置,但现在不可能了。(这是一个遗憾)我从中读到:ProgramaticallyconnectingtoanotherNetworko