Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7540929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:45:44+00:00 2026-05-30T07:45:44+00:00

So I have a SyncAdapter implemented in my app. I use the user’s existing

  • 0

So I have a SyncAdapter implemented in my app. I use the user’s existing Google account since I am syncing with Google Tasks. In the app, users have to go to preferences, enable sync and select an account. At this point I try to fetch an authToken which will create a pop-up asking the user to authorize my app to use their selected Google account.

enter image description here

This all works great if the user has never installed my app before. But, assume now that the user un-installs the app and re-installs it at a later time. When they open up the app, the settings will be unchecked of course. But what they’ll find is that the app syncs with their previously selected Google account anyway!

The reason is that the SyncAdapter is toggled to sync by default. E.g. this is the view in the Accounts & Sync screen after install before any changes have been made:

It is checked to sync by default. On first install this doesn’t matter because my app is not approved to access their Google account yet. But on re-install, it does matter.
So my question is: What do I need add/change/remove to make it unchecked by default?

My syncadapter.xml is as follows:

<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
    android:contentAuthority="com.nononsenseapps.NotePad"
    android:accountType="com.google"
    android:supportsUploading="true"
    android:userVisible="true" />

And in the manifest:

<service
    android:name=".sync.SyncService"
    android:exported="true" >
    <intent-filter>
        <action android:name="android.content.SyncAdapter" />
    </intent-filter>

    <meta-data
        android:name="android.content.SyncAdapter"
        android:resource="@xml/syncadapter" />
</service>

I do not make any calls in the Java code concerning sync until the user selects an account in settings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:45:45+00:00Added an answer on May 30, 2026 at 7:45 am

    You can store a SharedPreference and check it on SyncService start. If false, stop the service and don’t do anything.

    Remember to .apply() or .commit() your new shared preference value when you set it from the user config to enable sync.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a SyncAdapter that takes a com.google account and performs a sync
I have implemented SyncAdapter to perform sync of items in application. This adapter is
Have an app that can use tts to read text messages. It can also
Have just started using Google Chrome , and noticed in parts of our site,
Although I have implemented sync adapters and I can describe what a sync adapter
have been trying couple of hours now to make my iphone app universal. The
I have implemented a sync adapter and I want to get a callback when
I have a user id from a synced contact, I now try to retrieve
Does anyone know that when you have autosync enabled, how frequently are the google
Have just started to get into CakePHP since a couple of weeks back. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.