1. Check out our companion app, Forums for Android! Download from Google Play

Widget not clickable

Discussion in 'Application Development' started by pep987, Sep 6, 2010.

  1. pep987

    pep987 New Member
    Thread Starter
    5

    Sep 6, 2010
    2
    0
    5
    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);
    }

    }}
     

    Advertisement

  2. pep987

    pep987 New Member
    Thread Starter
    5

    Sep 6, 2010
    2
    0
    5
    Anyone???
     

Share This Page

Loading...