android请教context能否传入当前界面的Activity,请高手指教,谢谢
杨小扬 2014-03-28 03:22:46 详细说明,在Service中使用 View view = ((Activity)context).getWindow().getDecorView();
context声明如下
Context context;
context = this; //这个肯定不对
目的,使用Service打开的程序Activity可以获取界面
请高手指教
附现在错误的log
.example.startapptest/.TestService }: java.lang.ClassCastException: com.example.startapptest.TestService cannot be cast to android.app.Activity