Error while using PackageManager in Android

后端 未结 2 868
面向向阳花
面向向阳花 2020-12-21 21:24

I got a problem in one Android Application which I am working in which I am getting error when I use PackageManager.

The Application is as follows:

Home.j

相关标签:
2条回答
  • 2020-12-21 22:00

    try this::

    this.getPackageManager().getApplicationInfo(this.getPackageName(), 0);
    
    0 讨论(0)
  • 2020-12-21 22:01

    Result doesn't extend Context like your Activity class does. So the method isn't available in that class. You need to call act.getPackageManager() inside there instead of this.getPackageManager().

    0 讨论(0)
提交回复
热议问题