シンプルなブロードキャストリスナーを使って遊んでいましたが、そこにはtextView.setText( "text")のようなことがあります。しかし、リスナーはかなり大きなものになり、私は別のクラスに入れました。 私はAAが好きです、私は分離されている私のBroadcastReceiverから現在の活動からのビューを管理し続けるだけです。私のような何かをするとき、しかし:Android Annotationを使用して私のBroadcastReceiverにActivityインスタンスを挿入するにはどうすればよいですか?
Error:(25, 2) error: org.androidannotations.annotations.RootContext can only be used in a class annotated with @org.androidannotations.annotations.EBean.
私は上記@EBean追加しようとすると、私はさらに悪いことがあります:
Error:(27, 28) error: Something went wrong: Unexpected error in AndroidAnnotations 4.2.0!
You should check if there is already an issue about it on https://github.com/androidannotations/androidannotations/search?q=java.lang.ClassCastException&type=Issues
If none exists, please open a new one with the following content and tell us if you can reproduce it or not. Don't forget to give us as much information as you can (like parts of your code in failure).
ありがとうございます。しかし、この場合にUIとやりとりする方法は? AAを使用する前に、私はWarningActivityを使ってコンストラクタを作成しました。アクティビティでは、 'private BroadcastReceiver stateReceiver = new WarningActivityStateListener(this);'のようになり、受信者では 'WarningActivityStateListener(WarningActivity activity){ \t \t this.activity = activity; \t} ' - アクティビティを使用してビューを変更することができます。 AAと交換する方法を教えてください。 – Eugene
私はAppのIntentBuilderが助けてくれるかもしれないと思うが、わからない) – Eugene
@Eugene私は答えを更新した。 – WonderCsabo