我已经创建了一个自定义帐户类型,我可以在android ContactsContract ContentProvider中成功创建该类型的联系人.但是,在编辑默认联系人应用程序中的联系人时,我很难弄清楚如何获取我的自定义帐户标签和图标.
编辑自定义联系人类型时,标签应为"联系人",右侧是应用程序图标.相反,编辑我的类型的联系人始终显示"仅限电话,未同步的联系人"标签.有关示例,请参见下面的第一个屏幕截图
奇怪的是,它确实提取了我的帐户名称,您可以在错误标签下面的屏幕截图中看到它(以"+1415"开头).
我已经在帐户下的设置应用程序中成功显示了我的应用程序的标签和图标,所以我知道我正在做正确的事情.请参阅下面的第二个屏幕截图,以获取相关证明(帐户标签为"Bolt").
我有以下authenticator.xml:
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="@string/account_type"
android:label="@string/app_name"
android:icon="@drawable/app_icon"
android:smallIcon="@drawable/app_icon" />
Run Code Online (Sandbox Code Playgroud)
这是我的syncadapter.xml:
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="@string/contacts_content_authority"
android:accountType="@string/account_type"
android:userVisible="true"
android:allowParallelSyncs="false"
android:isAlwaysSyncable="true"
android:supportsUploading="false" />
Run Code Online (Sandbox Code Playgroud)
任何人都可以指出我哪里出错吗?我可以根据需要提供更多信息.我尝试使用CLIENT_IS_SYNCADAPTER参数从我的SyncAdapter中创建联系人但没有改变任何内容.我也尝试过其他一些东西,但还没有任何工作.
android android-syncadapter android-contacts android-account
在php中如何在不使用键周围的方括号的情况下访问数组的值?我的特殊问题是我想访问函数返回的数组元素.假设函数(args)返回一个数组.为什么$ var = function(args)[0]; 关于方括号向我大吼大叫?我可以做一些像$ var = function(args).value(0); 还是我错过了一些非常基本的东西?