我在设置分隔符的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个但没有成功.
我是这个Simple XML序列化程序的新手,我想解析IGN新闻源.问题是我收到以下错误:
Unable to satisfy @org.simpleframework.xml.Element(data=true, name=description, required=true, type=void) on field 'description' private java.lang.String org.android.entities.Channel.description for class org.android.entities.Channel at line 2
Run Code Online (Sandbox Code Playgroud)
xml看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.ign.com/~d/styles/itemcontent.css"?><rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>IGN All</title>
<description>The latest IGN news, reviews and videos about video games, movies, TV, tech and comics</description>
<link>http://pipes.yahoo.com/pipes/pipe.info?_id=5985e93c1e0bc73949d56890f4462756</link>
<atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=5985e93c1e0bc73949d56890f4462756&_render=rss&page=2" />
<pubDate>Wed, 17 Oct 2012 20:05:24 +0000</pubDate>
<generator>http://pipes.yahoo.com/pipes/</generator>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.ign.com/ign/all" /><feedburner:info uri="ign/all" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Android 上实现 FIDO2。我的域上托管有 assetlinks.json(抱歉,我不想也不确定是否允许透露整个网址)。我定义了 asset_statements 字符串并将其添加到我的清单中,并且还实现了整个获取注册质询逻辑,其中我从 PublicKeyCredentialCreateOptions 创建待处理意图。启动意图后,我看到一个白色屏幕,它显示并关闭得非常快,没有任何描述性错误或任何东西,我不知道如何调试这个问题。日志显示:
ActivityTaskManager: Displayed com.google.android.gms/.fido.fido2.ui.Fido2FullScreenActivity
E/Fido: [DigitalAssetsAssociationChecker] JSON Object doesn't have linked key
E/Fido: [Fido2RequestController] The incoming request cannot be validated
E/Fido: [Fido2RequestController] The incoming request cannot be validated
Run Code Online (Sandbox Code Playgroud)
在https://developers.google.com/digital-asset-links/tools/generator上,它说我的域授予应用程序深度链接到我的包名称。
我在用com.google.android.gms:play-services-fido:18.1.0
日志中的错误没有任何帮助,我不确定我是否仍然遗漏了一些东西,任何帮助将不胜感激。
我遇到的问题是,每次我执行相同的查询时,Realm有时会返回不同的数据.目前我正在使用SyncAdapter进行上传.我们的想法是尝试实现离线模式.
因此,当用户创建项目时,它会被添加到Realm db.我通过获取maxId并为其添加1000来手动生成该项目的ID.之后我将itemID发送到UploadSyncAdapter,在那里我获得itemById并将其发送到后端,后端返回带有真实ID的项目.所以在那之后我删除旧项目,然后将新项目插入Realm.
在我返回并读取数据后,它每秒返回一次,例如一个115号数据的数组,另一个是116号数组的数组.我甚至用ID搜索带有调试器的项目,它真的找到了项目,第二次没有.但是看起来我重建项目后项目就在那里并且它正常工作,或者如果我使用Instant Run重新运行应用程序.
任何帮助赞赏...
UPDATE 顺便说一下我使用RXjava从服务器获取数据,但它正在当前线程(SyncAdapter线程)上进行订阅和观察.
这是代码:
@Override
public void onNext(TaskResponse taskResponse) {
tasksDatabaseManager.deleteTaskById(taskId);
List<Task> tasks = taskResponse.getTaskDataList();
tasksDatabaseManager.insertTasks(tasks);
}
public void deleteTaskById(int taskId){
Realm realm = Realm.getDefaultInstance();
realm.beginTransaction();
RealmResults<Task> rows = realm.where(Task.class).equalTo(ID, taskId).findAll();
rows.deleteAllFromRealm();
realm.commitTransaction();
realm.close();
}
private void copyOrUpdateTasks(List<Task> tasksList){
Realm realm = Realm.getDefaultInstance();
ArrayList<Task> updatedTaskList;
//first initialize task permissions
updatedTaskList = filterTasksByPermission(tasksList);
//initialize custom task data
for (Task task : updatedTaskList) {
initializeTaskCustomFields(task);
}
//save new data
Log.d(TAG, "tasks number before update: " + getTasks().size()); …Run Code Online (Sandbox Code Playgroud)