I'm not sure why Android allows me to do this? Or is this even valid?
I have code like this:
LinearLayout linearLayout = (LinearLayout) this.findViewById(R.id.mainid);
findViewById returns a View, but I'm casting it to a LinearLayout which extends a ViewGroup. Wouldn't this be a dangerous thing to do since, I'm getting none of the the LinearLayout properties that may need to be set? Or wouldn't calling one of the methods from this cast cause issues since we have not allocated memory to it yet?