How to mask onUpdate()method when i add widget to the home screen?
<p>How to mask onUpdate() method when i add widget to the home screen?</p>

<p>I have a widget that listens for user clicks..and i respond to it in onUpdate()..
The problem is,onUpdate() gets executed even when i add widgets to home screen.</p>

<pre><code>  @Override
  public void onUpdate(Context context, AppWidgetManager appWidgetManager,
      int[] appWidgetIds) {

          if(flag)
                {
                Toast.makeText(context, "OFF", Toast.LENGTH_SHORT).show();
flag=false;
                }
          else
                {
                Toast.makeText(context, "ON", Toast.LENGTH_SHORT).show();
flag=true;
                }
}
</code></pre>

<p>Or how can i respond to user clicks if not in onUpdate() method?</p>
