title: How can i run methods in AppWidget?
body: <p>i learned today how to develop AppWidget and my question is, how can i run methods in the app widget?
  example:
  I have a button in the xml and i want the button calculate something.
  -the part of create the widget works fine and now i want to add some methods to the button.
  how does its works in "App Widgets"?</p>
  
  <p>here is my code:</p>
  
  <pre><code>public class WorkClockWidget extends AppWidgetProvider {
  
      MySharedPreferences shared;
      RemoteViews views;
      private Context context;
      private String text;
  
      @Override
      public void onUpdate(Context context, AppWidgetManager appWidgetManager,
              int[] appWidgetIds) {
  
          for (int i = 0; i &lt; appWidgetIds.length; i++) {
  
               views = new RemoteViews(context.getPackageName(), R.layout.clock_widget);
  
               /// i have button in the "R.layout.clock_widget" .
               //what i need to do if i want the button run the  "someText()" method?
  
  
              appWidgetManager.updateAppWidget(appWidgetIds[i], views);
  
          }
      }
  
  
      //The method i want to run when i press on the button.
      public String someText(){
          System.out.println("Works!!!");
          return "Test if this method works";
      }
  
  
  
  }
  </code></pre>
  
  <p>One more question:
  If i want my widget add data to my database, i have to use contentProvider?</p>