Esempio n. 1
0
  private void loadFeed(ParserType type) {
    try {
      Log.i("AndroidNews", "ParserType=" + type.name());
      FeedParser parser =
          FeedParserFactory.getParser(type, "http://feed43.com/hlntvradioprint.xml");
      List<Message> list = parser.parse();
      Message html = list.get(0);
      String string = html.getDescription();
      // String string = R.string.;
      WebView webview = (WebView) findViewById(R.id.webView1);
      webview.getSettings().setPluginState(PluginState.ON);
      webview.getSettings().setJavaScriptEnabled(true);
      // String summary = "<html><body>You scored <b>192</b> points.</body></html>";
      webview.loadDataWithBaseURL("", string, "text/html", "utf-8", "");
    } catch (Throwable t) {

    }
  }
Esempio n. 2
0
 private void loadFeed(ParserType type) {
   try {
     Log.i("AndroidNews", "ParserType=" + type.name());
     FeedParser parser = FeedParserFactory.getParser();
     long start = System.currentTimeMillis();
     messages = parser.parse();
     long duration = System.currentTimeMillis() - start;
     Log.i("AndroidNews", "Parser duration=" + duration);
     String xml = writeXml();
     Log.i("AndroidNews", xml);
     List<String> titles = new ArrayList<String>(messages.size());
     for (Message msg : messages) {
       titles.add(msg.getTitle());
     }
     ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.row, titles);
     this.setListAdapter(adapter);
   } catch (Throwable t) {
     Log.e("AndroidNews", t.getMessage(), t);
   }
 }