package com.some.company; @EActivity public class MyActivity extends Activity { // ... }
package com.some.company; public final class MyActivity_ extends MyActivity { // ... }
<activity android:name=".MyListActivity_" />
startActivity(this, MyListActivity.class);然而,如果使用AndroidAnnotations的话,真正被启动的activity是MyListActivity_而不是MyListActivity:
startActivity(this, MyListActivity_.class);
// Starting the activity MyListActivity_.intent(context).start(); // Building an intent from the activity Intent intent = MyListActivity_.intent(context).get(); // You can provide flags MyListActivity_.intent(context).flags(FLAG_ACTIVITY_CLEAR_TOP).start(); // You can even provide extras defined with @Extra in the activity MyListActivity_.intent(context).myDateExtra(someDate).start();
MyListActivity_.intent(context).startForResult();
startService(this, MyService.class);
startService(this, MyService_.class);
// Starting the service MyService_.intent(context).start(); // Building an intent from the activity Intent intent = MyService_.intent(context).build(); // You can provide flags MyService_.intent(context).flags(Intent.FLAG_GRANT_READ_URI_PERMISSION).start();
AndroidAnnotations使用说明书—AndroidAnnotations是如何工作的?
原文地址:http://blog.csdn.net/ekeuy/article/details/39670127