2010-09-04 94 views
0

這是在onCreate()中調用的,我如何加快方向切換?切換到橫向方向很慢

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); 
     } 

回答

2

每次方向改變時都不要下載相同的資源。緩存它!

+0

任何示例顯示緩存圖像的最佳方式? – 2010-09-04 17:53:38

+0

我不知道有關示例,但Android文檔非常清晰。也許你可以谷歌的東西,如'ClassName安卓'這裏有一個不同的方式來存儲/緩存文件列表: http://developer.android.com/guide/topics/data/data-storage.html – 2010-09-05 04:53:11