Zhen Liu
Zhen Liu

Reputation: 7932

How to import the generated activity class androidannotation

I just started playing around with android annotation.

I know that when I do @Eactivity, another ActivityName_ class is generated instead.

Now, in my code, i have ActivityName.this written somewhere. But when i change it into ActivityName_.this, my compiler starts to complain that it is not recognized. My question is how do I import the proper ActivityName_ ?

Upvotes: 0

Views: 84

Answers (1)

WonderCsabo
WonderCsabo

Reputation: 12207

First of all, you do not have to change all the class names to the generated class name. In this case, writing ActivityName.this will work just fine. Actually you only have to use the generated class names for Activitys in two places:

  1. in the manifest where you declare the Activity
  2. in your intents, where you start an Activity (and you can use the generated Intent builder: ActivityName_.intent(this).start()

The generated classes will be available after you compile (make) the project. So please compile the classes first.

Upvotes: 1

Related Questions