更新到Android Studio 2.0后,我的调试器停止工作.当我尝试将我的应用程序作为调试运行时,我等待调试器卡住了.我仍然可以正常运行app.
所以在这个问题上有很多帖子,我已经尝试了我能找到的一切:
因为我已经开始越来越好地采用Fragments,但随着Fragments功能的增加(片段中的片段,MapFragments),我开始达到一个我需要定义何时应该将新的View/Action作为片段进行定义的点还是作为一项活动?
活动定义为:
活动是用户可以做的单一,专注的事情.
但是片段有点采用了这个定义,而不是文档中描述的:
例如,新闻应用程序可以使用一个片段在左侧显示文章列表,另一个片段在右侧显示文章 - 两个片段都出现在一个活动中
这是用户可以在一个具有两个片段的活动中执行的两件事.
所以我想要一些输入/帮助来确定什么是最好的方法来决定我是否应该将新的操作/视图作为片段或活动进行?
所以我复制了Android的扩展包示例,并根据谷歌提供的指南运行.我已成功通过存储本地.obb文件使其工作,但我无法让它与下载.obb文件一起工作.状态已更改为IDownloaderClient.STATE_COMPLETED但未找到任何文件.
我经历过的步骤:
BASE64_PUBLIC_KEY,new package name,version number)请帮助获取下载的扩展文件.
编辑:在第4步,我现在得到下载失败,因为无法找到资源.
编辑2:所以在调试之后,我看到状态变为无需下载,但无法验证文件,因为它丢失了.因此,出于某种原因,它认为该文件已被下载.
编辑3:所以在DownloaderService.class中我们有一个run()方法,它使得getExpansionURLCount()返回0.文档说:this will return zero if there has been no LVL fetch in the current session.经过多次挖掘后,我发现我从Google获得processServerResponse()的响应中包含响应代码256并且没有密钥FILE_URL.那么原因是什么?
我在设置分隔符的drawable时遇到问题.我的style.xml看起来像这样:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="HCLTheme" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/HCLActionBarStyle</item>
<item name="actionBarStyle">@style/HCLActionBarStyle</item>
<item name="android:actionBarTabBarStyle">@style/HCLActionBarTabBarStyle</item>
<item name="android:actionBarTabStyle">@style/HCLActionBarTabStyle</item>
</style>
<style name="HCLActionBarStyle" parent="android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/hcl_actionbar_drawable</item>
<item name="background">@drawable/hcl_actionbar_drawable</item>
<item name="android:titleTextStyle">@style/HCLActionBarTitle</item>
</style>
<style name="HCLActionBarTabBarStyle" parent="@android:style/Widget.Holo.ActionBar.TabBar">
<item name="android:showDividers">middle</item>
<item name="android:divider">@drawable/divider</item>
<item name="android:dividerPadding">0dp</item>
</style>
<style name="HCLActionBarTabStyle" parent="@android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">@drawable/action_bar_tab_style</item>
</style>
<style name="HCLActionBarTitle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@android:color/white</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
在HCLActionBarTabBarStyle中,我将@ drawable/divider设置为制表符分隔符.这个drawable是一个9patch图像,一个垂直的黑色线条.
在我在xml中设置可绘制的分隔符之前我得到了正常的白色分隔符,如下所示:

在styles.xml中设置drawable之后我得到了这个:

因此,您可以看到分频器变得更宽,而不是9patch图像中的黑色垂直线.我甚至不确定分隔器的抽屉是什么?图片或图层列表,还是可以是颜色?事实上,我尝试了所有这3个但没有成功.
所以我们一直在使用Groups来保存和检索扩展和主应用程序中的一些数据,一切都适用于Swift 2.3,但随后我们更新到Swift 3.0并遇到了一些问题.
给我们提出问题的当前实现如下:
open class SomeClass: NSObject, NSCoding {
open var someVar: Int!
open func encode(with aCoder: NSCoder) {
aCoder.encode(self.someVar, forKey:"someVar")
}
public required convenience init?(coder decoder: NSCoder) {
// this is where it breaks
self.someVar = decoder.decodeInteger(forKey: "someVar")
}
}
Run Code Online (Sandbox Code Playgroud)
抛出以下错误:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeInt32ForKey:]: value for key (someVar) is not an integer number'
Run Code Online (Sandbox Code Playgroud)
有趣的是Swift 2.3的旧版实现没有任何问题:( self.someVar = decoder.decodeObject(forKey: "someVar") as! Int我从其他帖子中了解到这不起作用......)
那么我可能做错了什么?应该说原始值是从float中检索并转换为int.
如何为listFragment创建平滑的setSelection(position).对于常规列表视图,可以调用smoothScrollToPosition(position),但这仅适用于api lvl 8及更高版本,但这并不重要,因为它不适用于listfragment而不适用于api lvl 7.
任何有助于实现这一点的想法和建议都非常感谢.
我想添加动画,以便我的imageview向左滑动,离开屏幕并从右侧进入,滑回原来的位置.我尝试过做这样的事情..
<translate
android:duration="1000"
android:fromXDelta="0"
android:toXDelta="-100%p" />
<translate
android:startOffset="1000"
android:duration="1000"
android:fromXDelta="100%p"
android:toXDelta="0" />
Run Code Online (Sandbox Code Playgroud)
但动画不是我的愿望..任何人都可以帮助我
我最近想submodules从GIT我的Android项目中采用,但偶然发现了一些问题.
背景故事
我有多个项目,但许多项目使用相同的外部库(Android库项目),以使GIT更清洁,并使每个项目的GIT包含我为Android库项目使用GIT子模块所需的所有材料.这部分工作正常我将库作为项目的子模块包含在内.
问题
但Android使用这些库项目,基本上是一个常规项目,它被添加到项目中,我只能在Eclipse中添加一次相同的项目.因此,如果我需要一次处理多个项目,我必须使用Eclipse/workspace的多个实例,而不是以常规方式使用Eclipse.
有没有办法在eclipse中只有一个我的库项目实例,同时所有项目都引用它们各自的库?或任何其他建议我应该如何处理这个?
非常感谢任何帮助
当我构建项目时,我收到“为较新版本构建”警告(请参阅底部的堆栈跟踪)。
我确信这是正确的版本,因为我正在自己构建它,并且我已经使用 otool (/sf/answers/2266793301/)进行了检查。
该设置是使用 xcode 命令工具 (libA.a) 构建的 C++ 库,然后将该库包含到构建静态库 (libWordprediction) 的 xcode 项目中。从那里它被包含到我的主要 iOS 项目中。
每次我们构建一个二进制文件时,我们都会将它们一起脂化为一个胖二进制文件,以便为模拟器和设备构建。
现在,除了警告之外,设置工作没有任何问题,但我真的很想摆脱警告(而不仅仅是使用 -w 选项!)
Showing All Messages
Ld /Users/me/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da normal armv7
cd /X/git/myproject-iOS
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk -L/Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Products/Debug-iphoneos -L/X/git/myproject-iOS/myproject/Resources/ReaderResources/Libraries -L/X/git/myproject-iOS/myproject/Resources/ReaderResources -L/x/Libraries -L/X/git/myproject-iOS/myproject/Module/OCRMODULE/MobileOCR/lib/combined -F/Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Products/Debug-iphoneos -F/X/git/myproject-iOS -F/X/git/myproject-iOS/Build -filelist /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject_da.swiftmodule -lxml2 -lstdc++ -lcrypto -lssl -lxml2 -lstdc++ -lcrypto -lssl …Run Code Online (Sandbox Code Playgroud) 所以我得到我的logcat垃圾邮件这个datarouter错误.谁可以帮助我解决这个问题并告诉我它为什么会发生?
哦,我尝试重新启动手机和日食.
编辑:它似乎主要发生在我的Mac工作计算机上.
以下是每30秒发送一次完整垃圾邮件的日志:
11-23 14:25:46.917: E/DataRouter(82): After the usb select
11-23 14:25:46.917: E/DataRouter(82): Before checking the modem suspend state
11-23 14:25:46.917: E/DataRouter(82): PDP is resumed now
11-23 14:25:46.917: E/DataRouter(82): After checking the modem suspend state
11-23 14:25:46.917: E/DataRouter(82): Path set is DATA_PATH_CHAR_MODEM
11-23 14:25:46.917: E/DataRouter(82): Send [1] bytes to SMD. message:A
11-23 14:25:46.917: E/DataRouter(82): Sending data to SMD: Len = [1]
11-23 14:25:46.917: E/DataRouter(82): buffer = [A]
11-23 14:25:46.917: E/DataRouter(82): Wrote 1 chars to EXTERNAL PORT fd=12 ch = …Run Code Online (Sandbox Code Playgroud)