Skip to content

Commit

Permalink
Merge pull request #2939 from Catrobat/hotfix-0.9.40
Browse files Browse the repository at this point in the history
Hotfix 0.9.40
  • Loading branch information
wslany authored Aug 15, 2018
2 parents 8e838ba + fb819cd commit 5ce586e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions catroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ android {
targetSdkVersion 22
applicationId appId
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
versionCode 45
versionCode 46
println "VersionCode is " + versionCode
versionName "0.9.38"
versionName "0.9.40"
println "VersionName is " + versionName
buildConfigField "String", "GIT_DESCRIBE", "\"${versionName}\""
buildConfigField "String", "GIT_CURRENT_BRANCH", "\"${getCurrentGitBranch()}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
Expand Down Expand Up @@ -158,7 +159,16 @@ private void cloneFormulaBrick(FormulaBrick formulaBrick) {
}

private static void showFragment(View view, FormulaBrick formulaBrick, Brick.BrickField brickField, boolean showCustomView) {
Activity activity = (Activity) view.getContext();

Context context = view.getContext();
while (context instanceof ContextWrapper) {
if (context instanceof Activity) {
break;
}
context = ((ContextWrapper) context).getBaseContext();
}

Activity activity = (Activity) context;

FormulaEditorFragment formulaEditorFragment = (FormulaEditorFragment) activity.getFragmentManager()
.findFragmentByTag(FORMULA_EDITOR_FRAGMENT_TAG);
Expand Down

0 comments on commit 5ce586e

Please sign in to comment.