I am working with the altbeacon library using beacons background I use it to get events with firebase, when this background notifies the events that are scheduled on the same day, when it is open shows the events in a recycler view, I need that when you leave the beacon region change the events screen, but from a class that extends from Application I can not access the elements with findViewById, try with
View v = View.inflate(getApplicationContext(),R.layout.activity_event_list,null);
inside didExitRegion but any changes you make with v.findViewById.set something does not work I had to create a static method in the Activity and use a static activity
private static Activity activity = null;
protected void onCreate(Bundle savedInstanceState) {
....
activity = this;
....
public static void changeList() {
if (activity==null){
return;
}
RecyclerView rv = activity.findViewById(R.id.lista_eventos);
if (rv != null) {
if (NotificationService3.estado) {
rv.setVisibility(View.VISIBLE);
} else {
rv.setVisibility(View.GONE);
}
}
}
then within the method of the exitExit and the onCreate of the Activity I call the static function, I also tried to pass a method to the method to create the view with an inflate, by parameter but either called in the activity or in the application it does not result