title: How to create context in android.content.Context and android.app.Activity?
body: <p>I try to access information from Twitter and I followed this link: </p>
  
  <p><a href="http://code.google.com/p/sociallib/wiki/SocialLibGuide" rel="nofollow">http://code.google.com/p/sociallib/wiki/SocialLibGuide</a></p>
  
  <p>I don't understand the following two lines and it shows error in the following lines.</p>
  
  <pre><code>        twitter.requestAuthorization(this);
          twitter.authorize(this);
  </code></pre>
  
  <p>Full code is added below.</p>
  
  <p>It says that anroid.content.Context and android.app.Activity is required. I really don't know how to add them. Any help is appreciated. </p>
  
  <pre><code>package sociallibjar;
  
  import android.R;
  import android.content.Context;
  import com.expertiseandroid.lib.sociallib.connectors.SocialNetworkHelper;
  import com.expertiseandroid.lib.sociallib.connectors.TwitterConnector;
  import com.expertiseandroid.lib.sociallib.model.twitter.TwitterUser;
  import org.scribe.oauth.Token;
  
  public class TwitterApp {
  
      String CONS_KEY = "";
      String CONS_SEC = "";
      String CALLBACK = "";
  
      public void twiter() {
          try {
              TwitterConnector twitter = SocialNetworkHelper.createTwitterConnector(CONS_KEY, CONS_SEC, CALLBACK);
              twitter.requestAuthorization(this);
              twitter.authorize(this);
              Token at = twitter.getAccessToken();
              String token = at.getToken(); //You can store these two strings
              String secret = at.getSecret();//in order to build the token back
  
  
              Token myAccessToken = new Token(token, secret);
              twitter.authentify(myAccessToken);
              TwitterUser me = twitter.getUser(); //Retrieves the current user
              String nickname = me.getUsername(); //Some information is available through method calls
              int nbFollowers = me.nbFollowers; //Some is available through object fields
  
              System.out.println("You are logged in as " + nickname + " and you have " + nbFollowers + " followers"); //Now we can print the information we retrieved onscreen
  
              twitter.tweet("Tweeting from code"); //A simple tweet
  
              twitter.tweet("I have " + twitter.getUser().nbFollowers + " followers!");//A more elaborate tweet
              //twitter.logout(this); //Providing this code is located in an Activity (or Context) class
  
  
          } catch (Exception e) {
          }
  
      }
  
  
  }
  </code></pre>