0

I have a custom view that extends ListView. Depending on the current month, it displays 24 or 36 items.

These items display 6 rows of 7 cells each (it's a scrolling calendar). Each row is a LinearLayout I add to a ScrollView. Each row is a View I add to a LinearLayout. So, each CustomCalendar calls 7x6+6x4 = 42+24 = 66 times to addView(View), which makes for 1584 calls to addView, which is a ultra-slow process. It clogs up the main thread for a lot of time.

Is there any way to make this process faster? I've tried onDraw(canvas), but it's too difficult and anyway I couldn't make it work properly.

EDIT: People misunderstand my question. I have no downloaded images, I have no downloaded resources and I use no images. I only have views. My complain is that ViewGroup.addView works slow as hell, and I'm asking if there's an alternative for that.

Charlie-Blake
  • 10,832
  • 13
  • 55
  • 90

1 Answers1

0

Have tried to load the images using an AsyncTask?

Dinesh Venkata
  • 1,087
  • 1
  • 9
  • 22