0

I was trying to extend the PackageManager class( I must have been thinking something at that time) when I found queryIntentActivities() is an abstract Method of PackageManager class. I had used it as: packageManagerInstance.queryIntentActivities();

My Question is how did this method was implemented?

The same question can be asked for the implementation of getPackageManager() and getResources() there are many such abstract methods that you look through the API but can not find a proper implementation.

Traversing through the inheritence hierarchy given in api i.e Context, ContextWrapper, Activity etc gave no proper implementation but such that it will lead back to abstract method.

I have seen this question asking about getResources() and the accepted answer does not satisfies my query. A good point from that Qustion is Context,hence some ,abstract classes's implementation is provided by the Android system

But question is same.How implementation is provided such that it is invisible to api classes?

Community
  • 1
  • 1
bharat
  • 105
  • 1
  • 1
  • 8
  • `"I was extending PackageManager"` may i ask what for? how do you want to instantiate your class? – pskink Aug 21 '15 at 06:35
  • and if you are curious: just try `String name = getPackageManager().getClass().getName(); Log.d(TAG, "class name: " + name);` – pskink Aug 21 '15 at 07:00
  • I thought I would change the implementation a little bit(just being curious), I would definitely give it a try.. – bharat Aug 21 '15 at 12:56

0 Answers0