Hi, I am new to programming android, and have managed to cobble together a simple widget to turn the Master Sync option on and off. However when I click the widget it does nothing. Can someone advise me why?
This is the body of my Master Sync code:
public class MasterSync extends AppWidgetProvider {
/** Called when the activity is first created. */
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
// now label the property of the button
boolean sync = ContentResolver.getMasterSyncAutomatically();
if (sync){
ContentResolver.setMasterSyncAutomatically(false);}
else
//
if (!sync){
ContentResolver.setMasterSyncAutomatically(true);
}
}}
This is the body of my Master Sync code:
public class MasterSync extends AppWidgetProvider {
/** Called when the activity is first created. */
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
// now label the property of the button
boolean sync = ContentResolver.getMasterSyncAutomatically();
if (sync){
ContentResolver.setMasterSyncAutomatically(false);}
else
//
if (!sync){
ContentResolver.setMasterSyncAutomatically(true);
}
}}