Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

android.content.res.XmlResourceParser

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess this is a basic java question, but I'm posting it here because the interface is an Android interface.

So I was looking at android.content.res.XmlResourceParser . Apparently, this is the definition in the online API on Android developer site:

public interface XmlResourceParser implements AttributeSet XmlPullParser

How is this possible? Is this an error?
How can an interface IMPLEMENT another interface (or two)? Shouldn't it EXTEND them?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you wrote a test case that contained both interface A and interface B that implements interface A?
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right Nidhi, an interface cannot implement other interfaces but only extend them. I don't think this is a fault in the source code. Instead, the API doc generator seems to have a small bug in it, where it puts all "parent" interfaces into an "implements" list, even if the current class is an interface itself.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What happened when you wrote a test case that contained both interface A and interface B that implements interface A?


A compilation error ofcourse, as expected..... that's why this "official Google" documentation threw me off.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:You're right Nidhi, an interface cannot implement other interfaces but only extend them. I don't think this is a fault in the source code. Instead, the API doc generator seems to have a small bug in it, where it puts all "parent" interfaces into an "implements" list, even if the current class is an interface itself.


Thanks Rob. I thought I was going crazy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic