Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timob-10993: Fix crashing issue when targetSdkVersion is 11+ #2998

Merged
merged 2 commits into from
Sep 29, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ protected void onCreate(Bundle savedInstanceState)

// create the activity proxy here so that it is accessible from the activity in all cases
activityProxy = new ActivityProxy(this);


// Increment the reference count so we correctly clean up when all of our activities have been destroyed
KrollRuntime.incrementActivityRefCount();
Expand Down Expand Up @@ -679,6 +680,14 @@ public boolean dispatchKeyEvent(KeyEvent event)
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// If targetSdkVersion is set to 11+, Android will invoke this function
// to initialize the menu (since it's part of the action bar). Due
// to the fix for Android bug 2373, activityProxy won't be initialized b/c the
// activity is expected to restart, so we will ignore it.
if (activityProxy == null) {
return false;
}

if (menuHelper == null) {
menuHelper = new TiMenuSupport(activityProxy);
}
Expand Down