comparison between viewstub and latoutinflater to add view at runtime?

by Hitendrasinh Gohil » Thu, 19 May 2011 21:55:52 GMT


Sponsored Links
 hi,

What is the difference between using viewstub and layoutinflater to
inflate views at runtime?

-- 



Re: comparison between viewstub and latoutinflater to add view at runtime?

by Diego Tori » Thu, 19 May 2011 22:41:18 GMT


 If I recall correctly, ViewStub acts as a lazy XML include, in that the 
referenced view only gets added to the view hierarchy in the time that it's 
inflated, not ahead of time. The gain on this method is that it makes it 
quick and cheap to inflate a view, however, once it's inflated, it cannot be 
recreated or re-inflated (since the VS reference is gone from the 
heirarchy). LayoutInflater on the other hand allows you to inflate views at 
will, and add them directly into the heirarchy, however, you have to deal 
with the overhead of inflating them.

-- 


Sponsored Links


Re: Re: comparison between viewstub and latoutinflater to add view at runtime?

by Dianne Hackborn » Fri, 20 May 2011 00:13:16 GMT


 I'm not sure it makes sense to compare them.  ViewStub is a view that uses
LayoutInflater to inflate its view hierarchy when needed.  As far as
inflating the view hierarchy goes, they are the same.  They just are
different APIs, so the only interesting different between them is really the
obvious difference in how you use the API.

On Thu, May 19, 2011 at 7:41 AM, Diego Tori






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 



Other Threads

1. suggestion for keyboard

One thing that WinMo did correctly, is that it allowed you to select
an input type (writing, onscreen keyboard, etc) and stick with it.  It
remembered what you were using last.  The new software keyboard (Thank
you!) is great, but it would be better if you didn't have to mess with
toggling as much.

I work out six days a week, and I use the website dailyburn.com to
record my progress.  My workouts are logged into fields and then they
graph them for me, it's really a cool website.  Anyway, all of what
I'm inputting when I record my progress is numbers.  Weight, miles,
minutes, reps --- all numbers.  So every time I enter a field, the
software keyboard pops up and it's all letter keys, so I have to
toggle to numbers.  No big deal so far, right?  Well, today, for
example, my workout consisted of 40 fields.  That means I opened the
software keyboard and had to then toggle to number keys 40 times. Even
when I was in one field and then tapped into the one next to it the
keyboard refreshed itself and came back up as letters.  Tap, toggle,
type.  Tap, toggle, type, at least 40 times today in the space of an
hour.  When I had winmo, the first time I toggled to numbers, but
afterwards when I moved into a new field, the keyboard might disappear
for a second and reappear but it would remember that I was on the
number keypad and come back up with that keypad.

I would not suggest adding a row of numbers to the onscreen keyboard.
The keyboard already takes up enough room.

I would just add a checkbox in the keyboard settings that says
"remember keyboard previous state" or "allow sticky toggle" or
something.  Some people might not do as much numerical entry as I do,
but if you want android to be able to handle spreadsheets (google
docs) this is something that will definitely need to be addressed on
the keyboard at some point.  Luckily I have the G1, so the hardware
keyboard is perfectly fine.  But for devices that don't have that
option, the ability to not have the keyboard reset as you move from
field to field would be helpful.


One other thing I noticed, the suggested words section doesn't seem to
know it's own family.  I was typing in my email address and it never
once suggested "gmail" while I typed.

Thank you, thank you, thank you.
You don't know how much I appreciate you guys coming in and giving
both Mac and Microsoft a run for their money.  You guys do great work,
and I tell people all the time "It's not a matter of *IF* Google will
improve or update it's products, it's a matter of *how soon?* "
--~--~---------~--~----~------------~-------~--~----~

2. Check Download freeware for you

http://free-belajaronline.blogspot.com/2009/05/download-free-wma-to-mp3-converter.html
Download Free WMA to mp3 converter Windows

http://free-belajaronline.blogspot.com/2009/05/nokia-ovi-store-launch-is-complete.html
Nokia Ovi Store Launch Is A Complete Disaster

http://free-belajaronline.blogspot.com/2009/05/openx-keeps-on-growing-raises-10.html
OpenX Keeps On Growing, Raises $10 Million More

http://free-belajaronline.blogspot.com/2009/05/kindle-notes-and-highlights-now.html
Kindle Notes And Highlights Now Accessible On the

http://free-belajaronline.blogspot.com/2009/05/when-13-billion-people-are-too-many.html
When 1.3 Billion People Are Too Many

http://free-belajaronline.blogspot.com/2009/05/facebook-takes-that-200-million.html
Facebook Takes That $200 Million Investment From T

http://free-belajaronline.blogspot.com/2009/05/live-blogging-facebook-conference-call.html
Live Blogging The Facebook Conference Call

http://free-belajaronline.blogspot.com/2009/05/taking-yahoo-meme-for-spin-its-mediocre.html
Taking Yahoo Meme For A Spin: It A Mediocre Tumb

http://free-belajaronline.blogspot.com/2009/05/now-you-can-avoid-euro-disney-in-google.html
Now You Can Avoid Euro Disney In Google Earth, Jus

http://free-belajaronline.blogspot.com/2009/05/microsofts-bing-logo-leaked-by-way-of.html
Microsoft Bing Logo Leaked By Way Of Favicon?

http://free-belajaronline.blogspot.com/2009/05/awesome-potential-of-retweet.html
The Awesome Potential Of Retweet

http://free-belajaronline.blogspot.com/2009/05/it-may-not-be-making-tv-show-but.html
It May Not Be Making A TV Show, But Twitter Sure H

http://free-belajaronline.blogspot.com/2009/05/feel-dailyburn-gyminee-gets-new-name.html
Feel The DailyBurn: Gyminee Gets A New Name, Raise

http://free-belajaronline.blogspot.com/2009/05/ourparents-launches-free-customized.html
OurParents Launches Free Customized Service To Fin

http://free-belajaronline.blogspot.com/2009/05/contenture-launches-micropayment-based.html
Contenture Launches. Micropayment-Based Freemium M

http://free-belajaronline.blogspot.com/2009/05/need-witty-app-for-that-phrase-theres.html
Need A Witty pp For ThatPhrase? There An App

http://free-belajaronline.blogspot.com/2009/05/705-am-techcrunch-topsy-search-launches.html
7:05 AM TechCrunch Topsy Search Launches: ReTweets

http://free-belajaronline.blogspot.com/2009/05/topsy-search-launches-retweets-are-new.html
Topsy Search Launches: ReTweets Are The New Curren

http://free-belajaronline.blogspot.com/2009/05/exclusive-video-mark-zuckerberg-and.html
Exclusive Video: Mark Zuckerberg And Yuri Milner T

http://free-belajaronline.blogspot.com/2009/05/multiply-40-social-network-photo.html
Multiply 4.0: Social Network Photo Sharing Done Ri

http://free-belajaronline.blogspot.com/2009/05/adify-opens-up-api-to-expand-technology.html
Adify Opens Up API To Expand Technology For Ad Net

http://free-belajaronline.blogspot.com/2009/05/berita-berita-indonesia-27-maret-2009.html
Berita-Berita Indonesia 27 Maret 2009 | Surya Onli

http://free-belajaronline.blogspot.com/2009/05/indonesia-berita-27-maret-2009-detikcom.html
Indonesia Berita 27 Maret 2009 - detik.com

http://free-belajaronline.blogspot.com/2009/05/internet-explorer-8-tip-hide-text-and.html
Internet Explorer 8 Tip - Hide Text And Display Ic

http://free-belajaronline.blogspot.com/2009/05/1247-pm-tech-dreams-iconfinder.html
12:47 PM Tech Dreams IconFinder Excellent Search

http://free-belajaronline.blogspot.com/2009/05/iconfinder-excellent-search-engine-to.html
IconFinder Excellent Search Engine To Download H

http://free-belajaronline.blogspot.com/2009/05/meet-your-april-youperform-contest.html
Meet Your April YouPerform Contest Winners

http://free-belajaronline.blogspot.com/2009/05/download-unborn-2009-movie.html
Download The Unborn (2009) | Movie

http://free-belajaronline.blogspot.com/2009/05/download-va-hit-list-music.html
Download VA - The Hit List | Music

http://free-belajaronline.blogspot.com/2009/05/download-super-mario-collections-2009.html
Download Super Mario Collections 2009 | Games

http://free-belajaronline.blogspot.com/2009/05/download-avg-internet-security-v85339.html
Download AVG Internet Security v8.5.339

http://free-belajaronline.blogspot.com/2009/05/download-kelly-clarkson-all-i-ever.html
Download Kelly Clarkson - All I Ever Wanted (2009)

http://free-belajaronline.blogspot.com/2009/05/tribute-to-blink-182-vol-2.html
A Tribute to Blink-182 VOL 2

http://free-belajaronline.blogspot.com/2009/05/meaningful-tribute-to-fallen-soldiers.html
A meaningful tribute to fallen soldiers, on Google

http://free-belajaronline.blogspot.com/2009/05/find-right-music-for-your-workout-with.html
Find the right music for your workout with Beatsca

http://free-belajaronline.blogspot.com/2009/05/may-26-2009-download-squad-embed-flash.html
May 26, 2009 Download Squad Embed Flash games on y

http://free-belajaronline.blogspot.com/2009/05/embed-flash-games-on-your-site-with.html
Embed Flash games on your site with Heyzap

http://free-belajaronline.blogspot.com/2009/05/may-26-2009-download-squad-microsoft.html
May 26, 2009 Download Squad Microsoft releases Win

http://free-belajaronline.blogspot.com/2009/05/microsoft-releases-windows-vista-sp2.html
Microsoft releases Windows Vista SP2

http://free-belajaronline.blogspot.com/2009/05/may-26-2009-download-squad-nokia-ovi.html
May 26, 2009 Download Squad Nokia Ovi mobile app s

http://free-belajaronline.blogspot.com/2009/05/may-26-2009-download-squad-share-files.html
May 26, 2009 Download Squad Share files via Twitte

http://free-belajaronline.blogspot.com/2009/05/share-files-via-twitter-with-filetwt.html
Share files via Twitter with FileTwt

http://free-belajaronline.blogspot.com/2009/05/cross-platform-digital-audio-editor.html
Cross platform digital audio editor Reaper hits 3.

http://free-belajaronline.blogspot.com/2009/05/palm-webos-features-previewed-thanks-to.html
Palm WebOS features previewed thanks to a leaked e

http://free-belajaronline.blogspot.com/2009/05/how-new-yorker-cover-was-drawn-with-5.html
How a New Yorker cover was drawn with a $5 iPhone

http://free-belajaronline.blogspot.com/2009/05/boxnet-launches-tasks-global-folders.html
Box.net launches tasks, global folders and custom

http://free-belajaronline.blogspot.com/2009/05/autodesk-dragonfly-does-easy-web-based.html
Autodesk Dragonfly does easy, web-based home desig

http://free-belajaronline.blogspot.com/2009/05/reminderfeed-add-reminders-to-your-rss.html
ReminderFeed: add reminders to your RSS reader

http://free-belajaronline.blogspot.com/2009/05/644-am-download-squad-coming-soon.html
6:44 AM Download Squad Coming soon: Google Android

http://free-belajaronline.blogspot.com/2009/05/coming-soon-google-android-applications.html
Coming soon: Google Android applications on Ubuntu

http://free-belajaronline.blogspot.com/2009/05/us-android-users-can-finally-have-their.html
US Android users can finally have their Cupcake an

http://free-belajaronline.blogspot.com/2009/05/asal-mula-nama-bekasi.html
asal mula nama "bekasi"

http://free-belajaronline.blogspot.com/2009/05/asa-berujung-lara.html
asa berujung lara

http://free-belajaronline.blogspot.com/2009/05/lowongan-senior-junior-java-software.html
[Lowongan] Senior & Junior Java Software Developer

http://free-belajaronline.blogspot.com/2009/05/galileo-galilei-dihukum-karena.html
Galileo Galilei Dihukum Karena Kecerdasannya

http://free-belajaronline.blogspot.com/2009/05/picture-ternyata-di-bawah-tanah-bagus.html
Picture, Ternyata Di bawah tanah bagus

http://free-belajaronline.blogspot.com/2009/05/percobaan-nuklir-korea-dilakukan-hari.html
Percobaan Nuklir Korea Dilakukan Hari ini

http://free-belajaronline.blogspot.com/2009/05/berkat-game-matematika-tak-lagi.html
Berkat Game, Matematika Tak Lagi Menakutkan

http://free-belajaronline.blogspot.com/2009/05/tips-melindungi-mata-saat-berkomputer.html
Tips melindungi mata saat berkomputer

http://free-belajaronline.blogspot.com/2009/05/cepat-terindeks-di-search-engine.html
Cepat Terindeks di Search Engine

http://free-belajaronline.blogspot.com/2009/05/merusak-website-part-i.html
Merusak website Part I

http://free-belajaronline.blogspot.com/2009/05/rumus-cinta-kaum-adam-dari-mata-turun.html
RuMuS CinTa KauM AdaM ARi MaTa TuRuN Ke HaTi
http://free-belajaronline.blogspot.com/2009/05/curhat-eh-selingkuh.html
cUrHaTEh SeLiNgkuH ???

http://free-belajaronline.blogspot.com/2009/05/renungan-jangan-melihat-ke-belakang.html
Renungan, Jangan Melihat Ke Belakang

http://free-belajaronline.blogspot.com/2009/05/tips-agar-tak-muda-lelah.html
TIPS AGAR TAK MUDA LELAH
--~--~---------~--~----~------------~-------~--~----~

3. SDK 1.5 CPU usage

4. Unbale to opem IM app.

5. Identifying HSDPA usage

6. Receiving Changes to the Phone state

7. G1 calendar sync not working