1、錯誤:
The AndroidManifest.xml file contains the original component, and not the AndroidAnnotations generated component. Please register MyannoActivity_ instead of MyannoActivity
解決:在xml配置中activity設置
<activity android:name=".Test_" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
2、添加jar(兩個jar,導入到不同的lids/com-libs)
3、activity的註解:
@EActivity(R.layout.test)
public class Test extends Activity {
// 如果用註解,屬性訪問權限不能是private
@ViewById
EditText et;
@ViewById
TextView tv;
@Click
void btn() {
tv.setText("你輸入了:" + et.getText());
}
}