I'm currently working on an rss parser (edited example from Robhinds rssreader) it works so far, however, it takes almost a minute to start the app and it just displays a blank screen for like half a minute.
Now I was wondering how I can set up a progressbar that functions as a loading splash screen.
this is the starting activity, app starts here:
Using java Syntax Highlighting
- package com.tmm.android.rssreader;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.List;
- import org.json.JSONObject;
- import android.app.ListActivity;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.View;
- import android.widget.ListView;
- import com.tmm.android.rssreader.reader.RssReader;
- import com.tmm.android.rssreader.util.Article;
- public class RssActivity extends ListActivity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- List<JSONObject> jobs = new ArrayList<JSONObject>();
- try {
- jobs = RssReader.getLatestRssFeed();
- } catch (Exception e) {
- Log.e("RSS ERROR",
- "Error loading RSS Feed Stream >> " + e.getMessage()
- + " //" + e.toString());
- }
- RssListAdapter adapter = new RssListAdapter(this, jobs);
- setListAdapter(adapter);
- }
- @Override
- public void onBackPressed() {
- // TODO Auto-generated method stub
- super.onBackPressed();
- }
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- // TODO Auto-generated method stub
- super.onListItemClick(l, v, position, id);
- URL webURL = Article.url;
- Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(webURL
- .toString()));
- startActivity(myIntent);
- }
- }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
Now i've been wondering if it is somehow possible to do this with onPreExcecute, but i haven't gotton to far with that.
these are the classes i'm working with:
- Code: Select all
com.tmm.android.rssreader
/robhinds-AndroidRssReader-cbdb880/src/com/tmm/android/rssreader/RssActivity.java
/robhinds-AndroidRssReader-cbdb880/src/com/tmm/android/rssreader/RssListAdapter.java
com.tmm.android.rssreader.reader
/robhinds-AndroidRssReader-cbdb880/src/com/tmm/android/rssreader/reader/RssReader.java
com.tmm.android.rssreader.util
/robhinds-AndroidRssReader-cbdb880/src/com/tmm/android/rssreader/util/Article.java
/robhinds-AndroidRssReader-cbdb880/src/com/tmm/android/rssreader/util/RSSHandler.java
Any help, suggestions, pointings in the right directions or even better... a solution?




