2

I have this code

@EActivity(R.layout.activity_app_list)
public class MainListView extends SherlockFragmentActivity

{

}

and this is the exception

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.imona.android/com.imona.android.MainListView}; have you declared this activity in your AndroidManifest.xml?

Manifest

 <activity
            android:name="com.imona.android.MainListView_"
            android:label="@string/list_navigation"
            android:theme="@style/Theme.VPI" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

is it ok to use Android annotation with SherlockFragmentActivity ?

3 Answers3

2

With AndroidAnnotation you have to declare the generated classes (ie: with the _ suffix) in your AndroidManifest file.

Here, it seems you're trying to start the original class instead of the generated one. You should use the builder to start your activity. Please have a look to the wiki for more information about this.

DayS
  • 1,561
  • 11
  • 15
2

You should start your activity using the AA generated class instead your class:

startActivity(this, com.imona.android.MainListView_.class);

or by using the IntentBuilder:

com.imona.android.MainListView_.intent(this).start();

Hope it helps.

eltabo
  • 3,749
  • 1
  • 21
  • 33
0

The error message seems so clear. Look at this line :

android:name="com.imona.android.MainListView_"

You have declared MainListView_ , not MainListView

S.Thiongane
  • 6,883
  • 3
  • 37
  • 52