Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6963847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:50:53+00:00 2026-05-27T15:50:53+00:00

In Android ViewGroup inherits from View . A ViewGroup is a container which holds

  • 0

In Android ViewGroup inherits from View. A ViewGroup is a container which holds Views.

ViewGroup (LinearLayout)
View (TextView)

Why did folks at Android defined this relationship as Inheritance instead of composition. As the ViewGroup contains Views shouldn’t it be composition ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:50:53+00:00Added an answer on May 27, 2026 at 3:50 pm

    I think you’re getting too hung up on the wording.

    A “ViewGroup” has every bit as much reason to inherit from a “View” as a “TextView”, and “ImageView” or … more to the point … a “ScrollView” or a “SurfaceView” (the latter two both “contain things”).

    Perhaps “View” wasn’t necessarily the best choice of terms … but the class heirarchy makes complete sense. Regardless of what it’s subclasses are named 🙂

    IMHO …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import java.util.List; import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; import android.view.ViewGroup; import android.widget.*; import com.google.android.maps.MapView;
So I don't see where it is casting it into android.view.ViewGroup I get this
I have an app in android which retrieve a picture from http page.I'm asking
import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.RelativeLayout; public class
I am new to android and I want to retrieve button information which is
I am following the Android Gallery tutorial ( http://developer.android.com/guide/tutorials/views/hello-gallery.html ) but instead of simple
package woot.wat.wen; import android.app.Activity; import android.os.Bundle; import android.text.Layout; import android.util.Log; import android.view.KeyEvent; import android.view.View;
![alt text][1]Hi folks i am using admob ads for my android applicaiton.in portrait mode
This is my code: package com.example.testcode; import android.app.ListFragment; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Loader;
at android.hardware.Camera.native_setParameters(Native Method) at android.hardware.Camera.setParameters(Camera.java:647) at com.CameraApp.Preview.surfaceChanged(Preview.java:67) at android.view.SurfaceView.updateWindow(SurfaceView.java:538) at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339) at android.view.ViewGroup.drawChild(ViewGroup.java:1638) at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.