Final Local Variable may not have been initialized in anonymous inner class
问题 Here is my code: final Foo myFoo = new Foo(new Inner() { @Override callback(){ myFoo.bar(); } }); (With actual function names) final MyArrayAdapter aa = new MyArrayAdapter(new View.OnClickListener() { @Override onClick(){ aa.notifyDataSetChanged(); } }); Java is giving me an error about how myFoo might not have been initialized. Is there any way to fix this? I can potentially set the callback to null when I construct the object and then change it afterwards, but I'd hope for there to be a