Obteniendo un error con la barra de acción johannilssen

i'm developing an android app for 2.3.3, but I want to use an actionbar. After looking around for a bit I found johan nilssen ActionBar so I tried that.

I followed the whole README, but I'm getting error's at 2 functions which are not described.

actionBar.setHomeAction(new IntentAction(this, MainActivity.createIntent(this), R.drawable.ic_title_home_default));
actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default));

It gives these error's

The Method createIntent(MainActivity) is undefined for the type MainActivity


The method createShareIntent() is undefined for the type MainActivity.

I tried to make the methods myself but that did not worked out because I don't know what I have to put in.

preguntado el 28 de agosto de 12 a las 10:08

Post the link/stuff that u have followed.So that community can help you better. -

2 Respuestas

Asegúrate de que tu MainActivity extends the appropriate class. (i.e. Activity or ListActivity) It may not be inheriting needed methods.

Also my internet is buggy so i cant check it out myself but este might be a good resource for you to look at.

Respondido 28 ago 12, 11:08

Do you not need to give this Activity new name and declare it in Manifest Me gusta esto:

    android:label="@string/title_activity_main" >
        <action android:name="package name.HomeActivity" />
        <category android:name="android.intent.category.DEFAULT" />

Respondido 28 ago 12, 22:08

Can you explain that a little more, I don't know what you mean exactly. - elcad

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.