1. Download our Official Android App: Forums for Android!

Apps Widget not clickable

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

  1. pep987

    pep987 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Sep 6, 2010

    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Sep 6, 2010

    Sep 6, 2010
    2
    0
    5
    Anyone???
     

Share This Page

Loading...