title: How to parse a entirely html table from button and textview the sqlite table
body: <p>The idea is to parse the <a href="http://www.usp.br/coseas/COSEASHP/COSEAS2010_cardapio.html" rel="nofollow noreferrer">link</a> on click and transform it to a sqlite table, overwriting it always that the button is clicked again. My code before was only printing out everything, not separating data to cells, and I can't figure out how to adjust it.
  Tried to understand the code in <a href="https://stackoverflow.com/questions/6325067/java-android-html-table-parsing-to-database-sqlite">Java (Android) Html Table Parsing to Database (SQLite)</a>, but still not very clear to me.</p>
  
  <pre><code>public class BandecoActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_bandeco);
      Button updatebutton = (Button) findViewById(R.id.buttonupdate);
  
      updatebutton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              new Thread() {
                  @Override
                  public void run() {
                      String url = "http://www.usp.br/coseas/cardapio.html";
                      TextView cardapiotextview = (TextView) findViewById(R.id.textcardapio);
                      setContentView(R.layout.activity_bandeco);
                      try {
                          Document doc = Jsoup.connect(url).get();
                          Elements rows = doc.select("tr pre");
  
                          for (Element elem: rows) {
                             System.out.println(elem.text());
                             cardapiotextview.append(elem.text());
                          }
                      }
                      catch (IOException e) {
                          e.printStackTrace();
                      }       
                  }
                  }.start();
  
  
  
          }
      });
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.bandeco, menu);
      return true;
  }
  </code></pre>
  
  <p>Instead of printing out, I need to add to a sqlite table. After all the jsoup running, is necessary to textview the table in the activity. Please help as I'm new in android programming.</p>