【问题标题】:Sync Contacts with Android Application [closed]将联系人与 Android 应用程序同步 [关闭]
【发布时间】:2013-07-17 10:44:34
【问题描述】:

我想在 Android -> 设置中添加我的应用程序同步选项。

我已经创建了同步适配器,它运行良好..

但我的联系人没有添加到我的帐户下.. 我在“要显示的联系人”下获得了我的帐户,但是当我选择我的帐户时,该帐户中没有联系人。 谁能帮帮我...

我提到过很多类似thisthis

但我的问题没有在其中任何一个中讨论.. 提前谢谢你...

【问题讨论】:

    标签: android synchronization contacts accountmanager


    【解决方案1】:

    你可以试试这个链接来处理你的应用空闲时间

    Application idle time

    并且在(取自那个答案)

    public class ControlApplication extends Application{
    
        private static final String TAG=ControlApplication.class.getName();
        private Waiter waiter;  //Thread which controls idle time
    
        // only lazy initializations here!
        @Override
        public void onCreate(){
            super.onCreate();
            Log.d(TAG, "Starting application"+this.toString());
            waiter=new Waiter(15*60*1000); //15 mins
            waiter.start();
            setContentView(R.layout.blackscreen);
        }
    
        public void touch(){
            waiter.touch();
        }
    }
    

    您可以使用

    调用背景为黑色的 xml 文件

    编辑

    blackscreen.xml

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#000000"
        tools:context=".MainActivity">
    

    【讨论】:

    • 但是这段代码在哪里写??
    • 你能给我完整的文件代码吗??
    • ok.. 我 vl test n 让你知道.. 对不起,我是 android 的初学者,所以我对很多事情感到困惑......
    • Okie.. 完成后发表评论..
    • @angel..请付出一些努力并找到方法。我不认为这是一项如此繁忙的任务。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-17
    • 2011-10-09
    • 2011-07-26
    • 1970-01-01
    • 2016-09-17
    相关资源
    最近更新 更多