title: Android Widget calling enabled not when expected
body: <p>I am trying to find a way to check the number of contacts the user has set when the user adds my widget to the homescreen. if not then open my custom contact picker. </p>
  
  <p>When I hold on the homescreen, choose widgets, hold the widget icon, my program calls onEnabled</p>
  
  <pre><code>public void onEnabled(Context context) 
  {
          Log.i(TAG,"in onEnabled");
          SharedPreferences sharedPrefs = context.getSharedPreferences("settings_category", context.MODE_PRIVATE);
          if(sharedPrefs.getInt("numContacts", 0) == 0)
          {
              Intent con_intent = new Intent(context, ContactPrefActivity.class);
              con_intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              context.startActivity(con_intent);
              Toast.makeText(context, "No Contacts Selected", Toast.LENGTH_LONG).show();
          } 
  }
  </code></pre>
  
  <p>I want it to call when the widget is placed somewhere on the homescreen. </p>
  
  <ol>
  <li>Is 'onEnabled()' the right method? If it is, what am I doing wrong?</li>
  <li>If not then, which method is called when the widget is placed on the screen?</li>
  </ol>