How to call getWindow() outside an Activity in Android?

后端 未结 4 483
感情败类
感情败类 2020-12-09 01:23

I am trying to organize my code and move repetitive functions to a single class. This line of code works fine inside a class that extends activity:

getWindow         


        
4条回答
  •  星月不相逢
    2020-12-09 01:53

    Use

    getActivity().getWindow().requestFeature(Window.FEATURE_PROGRESS);
    

    It's will be easier

提交回复
热议问题