title: Publishing last tweet with twitter4j library - where exactly AsyncTask should be implemented?
body: <p>My code is simple: retreiving the last tweet from my home page and publishing in Textview field in my app. </p>
  
  <pre><code> public void lastTwitterpost() throws TwitterException
      {
          webView=(TextView) findViewById(R.id.webview);
  
          ConfigurationBuilder cf = new ConfigurationBuilder();
          cf.setDebugEnabled(true)
                  .setOAuthConsumerKey("YYOkYp9G85lFxfXZPQAWcjAmX")
                  .setOAuthConsumerSecret("TLZrCAgeiuCbN6WOoUzO6e0hfWySA01PEOK1KPEH6yB8kxEYSz ")
                  .setOAuthAccessToken("4188976763-zVUUUMwEKvBD6J9mE3tiscaKQD85vWRkIyPdqBl")
                  .setOAuthAccessTokenSecret("K1neDCJq9shWhBxxU6otD4PCU4HJObd8lch3X4XsRq5ew ");
  
          TwitterFactory tf = new TwitterFactory(cf.build());
          twitter4j.Twitter twitter = tf.getInstance();
  
  
  
              Log.d(TAG, "main: tweets messages:");
              int totalTweets = 1 ;// no of tweets to be fetched
              Paging paging = new Paging(1, totalTweets);
              List tweets = twitter.getHomeTimeline(paging);
  
              webView.setText(tweets.toString());
  }
  </code></pre>
  
  <p>But i get follow error:</p>
  
  <pre><code>FATAL EXCEPTION: main  Process: com.example.android.bluesky, PID: 8320
                        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.bluesky/com.example.android.bluesky.Search.SearchActivity}: android.os.NetworkOnMainThreadException
                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2406)
                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2466)
                            at android.app.ActivityThread.access$1200(ActivityThread.java:152)
                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
  </code></pre>
  
  <p>How can i handle it?</p>