I've about pulled out my hair over this one.  Not that it's a huge
deal, but I would like to know why this doesn't work?


I have a main class that extends listactivity.  In it's oncreate
method, I issue the appropriate Window.Progress usage function call.
In the locations in the code where I want the progress bar in the
title, I call the progressbar function with true or false in it's
parameter list.

However, the progress bar, never shows up.

Below is the shortened code for example.

It appears that because this is a listactivity, that the listview
doesn't respond to the call for the progress display, even tho
listactivity says it supposts the methods.  I also tried this with the
showDialog version and the same thing happend, I never get a dialog.

So, I must be doing something wrong, any takers?

Thanks in advance,
Alan


public class StockApp extends ListActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);

        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

        // If no data was given in the intent (because we were started
        // as a MAIN activity), then use our default content provider.
        Intent intent = getIntent();
        if (intent.getData() == null) {
            intent.setData(Stock.CONTENT_URI);
        }

        // Inform the list we provide context menus for items
        getListView().setOnCreateContextMenuListener(this);

        // Perform a managed query. The Activity will handle closing
and requerying the cursor
        // when needed.
        mCursor = managedQuery(getIntent().getData(), PROJECTION,
null, null,
                Stock.DEFAULT_SORT_ORDER);

        // Used to map stock entries from the database to views
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.main, mCursor,
                new String[] { Stock.SYMBOL, Stock.PRICE, Stock.DAY,
Stock.NAME }, new int[] { R.id.stock_symbol, R.id.stock_price,
R.id.stock_day, R.id.comp_name });
        setListAdapter(adapter);

       refreshStock();
    }

    private void refreshStock() {
        Uri mUri = getIntent().getData();
        mCursor.moveToFirst();
        int symbol_column = mCursor.getColumnIndex(Stock.SYMBOL);
        int id_column = mCursor.getColumnIndex(Stock._ID);


        setProgressBarIndeterminateVisibility(true);

        do {
                        // do some processing which takes a few
seconds
        } while (mCursor.moveToNext());

        setProgressBarIndeterminateVisibility(false);

    }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to