0

I want to extend android.net.wifi.WifiManager . Since extension methods does not exists for Java I wanted to extend the class itself.

I am however unable to do so, the WiFiManager constructor demands IWifiManager and that interface seems to be hidden.

What am I missing here, How can I extend the WiFiManager?

Aditya
  • 2,876
  • 4
  • 34
  • 30
Johan
  • 753
  • 2
  • 11
  • 31
  • 1
    try to compose your own class that _uses_ WifiManager instead. – Lovis Jan 10 '14 at 11:55
  • http://stackoverflow.com/questions/4359979/java-equivalent-to-c-sharp-extension-methods?answertab=active#tab-top – Muharrem Rambo Jan 10 '14 at 12:02
  • Muharrem Rambo, I know, I pointed that out in the question as background information. – Johan Jan 10 '14 at 12:05
  • Don L. Of course I could do that, but that would require more time than I have free on my hands right now, thus I wanted to extend the class itself. The alternatives I'm forced to feels awkward and clumsy with my .net background where this sort of thing feels to smooth. – Johan Jan 10 '14 at 12:07

1 Answers1

0

How can I extend the WiFiManager?

You can't, for the reasons you cited. They really should have marked the class as final.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491