Absturz in Android Native beim Wechsel zu einer neuen Aktivität
Meine Anwendung kann OpenFeint-Dashboardmethoden nicht öffnen. Die Implementierung der nativen c ++ - Bibliotheken verwendet cocos2d-x als Grafikbibliothek, verfügt jedoch über einen Handler und einen Wrapper, um die Verwendung von OpenFeint-Funktionen zu ermöglichen.OpenFeint-Initialisierungs- und Nichtaktivitätsmethoden funktionieren ordnungsgemäß.
Wenn UI-Dashboard-Funktionen wie openLaderBoards oder openAchievements entweder über einen Jni-Aufruf oder in der Java onCreate-Initialisierung aufgerufen werden, stürzt die Anwendung ab.
BEARBEITEN: Ich habe getestet und es passiert jede Änderung der Aktivität, die ich versuche, sogar meine eigenen neuen Klassen.
EDIT2: Ich habe ein Kopfgeld von +100 in einer ähnlichen Frage, jeder, der die Antwort findet, bekommt es.
Code
Aktivität:
<code>public class App extends Cocos2dxActivity{ private Cocos2dxGLSurfaceView mGLView; OpenFeintX m_kOpenFeintX; protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); // get the packageName,it's used to set the resource path String packageName = getApplication().getPackageName(); super.setPackageName(packageName); InternetConnection.setM_kActivity(this); m_kOpenFeintX = new OpenFeintX( this); setContentView(R.layout.applayout); mGLView = (Cocos2dxGLSurfaceView) findViewById(R.id.game_gl_surfaceview); mGLView.setTextField((EditText)findViewById(R.id.textField)); // Testspace for new Activities, OpenFeint or self-made // // Intent myIntent = new Intent(this, TestActivity.class); // startActivityForResult(myIntent, 0); // Dashboard.open(); // Cocos2d-x scene opens after this } static { System.loadLibrary("TestProject"); // Native library loaded for cocos2d-x } </code>
Verpackung:
<code>public class OpenFeintX { private static OpenFeintXHandler ms_kOpenFeintHandler; public OpenFeintX(Activity kActivity) { initializeOpenFeint("TestApp", "derp", "hurr", "6546516516541", kActivity, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ms_kOpenFeintHandler = new OpenFeintXHandler(); } public static void openLeaderBoards() { Message msg = new Message(); msg.what = OpenFeintXHandler.SHOW_LEADERBOARDS; ms_kOpenFeintHandler.sendMessage(msg); } </code>
Handler openDashboard Funktion:
<code>private void openLeaderBoards() { System.out.println("Opening Dashboard"); Dashboard.openLeaderboards(); } </code>
Manifest:
<code><application android:debuggable="true" android:label="@string/app_name"> <activity android:configChanges="orientation" android:label="@string/app_name" android:name=".App" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.openfeint.internal.ui.IntroFlow" android:label=".IntroFlow" android:configChanges="orientation|keyboardHidden" android:theme="@style/OFNestedWindow" /> <activity android:name="com.openfeint.api.ui.Dashboard" android:label=".Dashboard" android:configChanges="orientation|keyboardHidden" android:theme="@style/OFNestedWindow"/> <activity android:name="com.openfeint.internal.ui.Settings" android:label=".Settings" android:configChanges="orientation|keyboardHidden" android:theme="@style/OFNestedWindow"/> <activity android:name="com.openfeint.internal.ui.NativeBrowser" android:label=".NativeBrowser" android:configChanges="orientation|keyboardHidden" android:theme="@style/OFNestedWindow"/> </application> </code>
Stacktrace (wird in SO nicht eingerückt):