views:

63

answers:

1

This is getting called in onCreate(), how can I speed up orientation switching?

private void setupChartView(int position){
            Quote myQuote = quotesAdapter.getItem(position);
            this.symbol = myQuote.getSymbol();

            String url = "http://chart.finance.yahoo.com/z?s=" + symbol + "&t=1d&q=l&l=on&z=l&p=s&a=v&p=s&lang=en-US&region=US";

            if(chartImageView != null)
                imageDownloader.download(url, chartImageView);

            if(chartImageViewLandscape != null)
                imageDownloader.download(url, chartImageViewLandscape);
        }
+1  A: 

Don't download the same resources every time the orientation changes. Cache it!!!

Pierreten
any example showing the best way to cache the image?
Sheehan Alam
I don't know about examples, but the Android docs are pretty clear. Perhaps you can google things such as 'ClassName Android' here's a list of different ways to store/cache files:http://developer.android.com/guide/topics/data/data-storage.html
Miguel Morales