My application cannot open the OpenFeint panel methods. The implementation of the native C ++ libraries uses cocos2d-x as a graphics library, but it has a handler and a shell to use the OpenFeint functions. OpenFeint initialization and inactivity methods work correctly.
When UI control panel functions, such as openLaderBoards or openAchievements, are called from either a Jni call or in Java onCreate initialization, the application crashes.
EDIT: I tested, and this happens with any change in activity I'm trying, even with my new classes.
EDIT2: I have a +100 bounty in a similar question, anyone who comes up with an answer gets it.
the code
Activity:
public class App extends Cocos2dxActivity{
private Cocos2dxGLSurfaceView mGLView;
OpenFeintX m_kOpenFeintX;
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
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));
}
static {
System.loadLibrary("TestProject");
}
:
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);
}
Handler openDashboard:
private void openLeaderBoards() {
System.out.println("Opening Dashboard");
Dashboard.openLeaderboards();
}
:
<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>
Stacktrace ( SO):
http://pastebin.com/jsmSbgw4