0

I am using a SyncAdapter in my application in which the frequency of Periodic Sync is increased when user enters a particular activity.

I wanted to know if there is a way in which I can let the application know which activity has called the SyncAdapter?

I tried setting a public static boolean variable to true when it enters the fast frequency Activity but the SyncAdapter method onPerformSync() always prints false. What is the reason for this?

vjdhama
  • 4,878
  • 5
  • 33
  • 47
Roadblock
  • 2,041
  • 2
  • 24
  • 38

1 Answers1

0

Use the extras that are passed to your SyncAdapter to transport more information about the "trigger" of a sync action.

That your static variable is not properly set when questioned from the SyncAdapter could mean that you execute your sync service in a separate process than the rest of your app. This is usually done by specifying the android:process="..." attribute in the <service> definition.

Thomas Keller
  • 5,933
  • 6
  • 48
  • 80