Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4583736
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:15:23+00:00 2026-05-21T21:15:23+00:00

I’m still working on my application that has to store RSS data localy. So

  • 0

I’m still working on my application that has to store RSS data localy.
So far i managed to create a local database and parse the online RSS feed.
I also managed to put this information in the database so now the app will also be available while being offline.

However i can’t seem to figure out how to do the following:
I have 2 buttons, one of them reads the database titles and will go to a detailed page of your selection (still working on that)

My current problem is that i can’t seem to add a loading bar to pop up on the screen while the application is downloading the data from the internet. The screen is just blank for like 10 seconds and then the list pops up. here is the code that i’m using:

public class SynchDB_Activity extends ListActivity {

public List<Message> messages;
public List<String> titles;
//ProgressDialog dialog = ProgressDialog.show(SynchDB_Activity.this, "", "Downloading data...", true);

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.animal_list_view);

    loadFeed();
}

private void loadFeed(){

    try{
        BaseFeedParser parser = new BaseFeedParser();
        messages = parser.parse();

        List<String> titles = new ArrayList<String>(messages.size());

        DBAdapter db = new DBAdapter(this);

        for (Message msg : messages){
            titles.add(msg.getTitle());
            db.addRow(  
                msg.getTitle(), 
                msg.getDescription(), 
                "bla", 
                "http:/", 
                msg.getLink());
        }

        //dialog.dismiss();

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.row,titles);
        this.setListAdapter(adapter);

    } catch (Throwable t){
        Log.e("AndroidNews",t.getMessage(),t);
    }
}

So this code works and puts all the data in the local database. However i just cant make that loading bar working and it’s driving me crazy.

If anyone could help me out i would be gratefull!!!
I’ve been googling all day and nothing seems to do the trick….

many thanks

edit: As you can see in the code i display the list when its done. This is not nececary, but from the moment i remove the ArrayAdapter the app won’t work anymore.

Keep in mind that this all is quite new for me and i think that the main part where things are going wrong is useing the different layouts…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:15:24+00:00Added an answer on May 21, 2026 at 9:15 pm

    Use Async task and progress bar as shown here:

    public void  getrss()
    {
         try{
            class test extends AsyncTask{
    
    
                 TextView tv_per;
                 int mprogress;
    
                Dialog UpdateDialog = new Dialog(ClassContext);
    
                @Override
                protected void onPreExecute() {
                    // TODO Auto-generated method stub
                    mprogress = 0;
    
                    UpdateDialog.setTitle(getResources().getString(R.string.app_name));
                    UpdateDialog.setContentView(R.layout.horizontalprogressdialog);
                    TextView dialog_message =  (TextView)UpdateDialog.findViewById(R.id.titleTvLeft);
                    tv_per = (TextView)UpdateDialog.findViewById(R.id.hpd_tv_percentage);
                    dialog_message.setText(getResources().getString(R.string.dialog_retrieving_data));
                    dialog_message.setGravity(Gravity.RIGHT);
                    UpdateDialog.setCancelable(false);
                    UpdateDialog.show();
                    super.onPreExecute();
                }
    
    
    
                @Override
                protected void onProgressUpdate(Object... values) {
                    // TODO Auto-generated method stub
                    ProgressBar update = (ProgressBar)UpdateDialog.findViewById(R.id.horizontalProgressBar);
                    update.setProgress((Integer) values[0]);
                    int percent =  (Integer) values[0];
                    if(percent>=100)
                    {
                        percent=100;
                    }
                    tv_per = (TextView)UpdateDialog.findViewById(R.id.hpd_tv_percentage);
                     tv_per.setText(""+percent);
                }
    
    
    
                @Override
                protected Object doInBackground(Object... params) {
                    // TODO Auto-generated method stub
                    //your code
    }
    
                    super.onPostExecute(result);
                    UpdateDialog.dismiss();
                }
    
             }
             new test().execute(null);
    
         }
         catch(Exception e)
         {
             e.printStackTrace();
         }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I want to count how many characters a certain string has in PHP, but
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.