newInstance nie powiodło się: nie <init>
Nie mogę utworzyć instancji sub-aktywności. W logcat widzę tę linię:
01-22 15:14:38.906: DEBUG/dalvikvm(411): newInstance failed: no <init>()
To jest linia w dalvik, która generuje ten logcat.
/*
* public T newInstance() throws InstantiationException, IllegalAccessException
*
* Create a new instance of this class.
*/
static void Dalvik_java_lang_Class_newInstance(const u4* args, JValue* pResult)
...
/* find the "nullary" constructor */
init = dvmFindDirectMethodByDescriptor(clazz, "<init>", "()V");
if (init == NULL) {
/* common cause: secret "this" arg on non-static inner class ctor */
LOGD("newInstance failed: no <init>()\n");
dvmThrowExceptionWithClassMessage("Ljava/lang/InstantiationException;",
clazz->descriptor);
RETURN_VOID();
}
Oto działanie, które podejmuję, aby aktywować aktywność w programie obsługi zegara.
// move on to Activation
// ePNSplash is this activity a splash screen
Intent i = new Intent (ePNSplash.this, Activation.class);
startActivity (i);
Czynność, którą próbuję uruchomić, to 2 rozszerzenia powyżej działania
Oto pierwsze rozszerzenie
public abstract class AndroidScreen extends Activity {
....
public AndroidScreen (String title, AndroidScreen parent, AndroidScreen main)
{
super ();
myGlobals = Globals.getGlobals ();
myGlobals.myLogger.logString("AndroidScreen: 001");
myParent = parent;
myMainScreen = main;
myTitle = title;
}
To jest tylko konstruktor, który wydaje się być tą częścią, która ma problem. Oto drugie rozszerzenie i klasa, którą próbuję utworzyć.
public class Activation extends AndroidScreen {
public Activation (String title, AndroidScreen parent, AndroidScreen main)
{
super (title, parent, main);
}
Jestem całkowicie zdezorientowany, mam konstruktora, upewniam się, że nazywam moich super konstruktorów, co może być nie tak?
Dziękuję Ci
juliański