This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Button inheritance  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one please explain to me why is (in this example) the button class related to android.view??
Should the inheritance be related to android.widget?
Please see attached image
In the packages they are separated but in the reference help, Button is child of android.view.View which is completely separated from android.widget package
I don't understand how this inheritance structure works

Can somebody explain this to me?

Thanks!!!

inheritance.jpg
[Thumbnail for inheritance.jpg]
inheritance
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What, exactly, don't you understand about it? A class that extends some other class does not need to be in the same package (as you can see with android.widget.TextView extending android.view.View).

So when you say "android.view.View which is completely separated from android.widget package", nothing more is at work than the original package structure designer's ideas of what class should go into which package. That has no impact on the workings of those classes (and only a little impact on the overall class hierarchy). Those classes are not "separated" in any fundamental way.
 
Gustaf Garrison
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer Ulf !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!