what method I must use Instead of findViewById in app widget?
问题 When I use findViewById() I get an error. What method should I use, instead of findViewById() in my app widget? P.S.: I want to do something like: Button a = (Button) findViewById(R.id.button); in my screen widget 回答1: You don't need a findViewById() in Widget just do this create a static variable, which will be your onClick name tag: private static final String MyOnClick = "Button OnClick"; Set this onClick tag to your view as below: RemoteViews views = new RemoteViews(context.getPackageName