Skip to content

Commit

Permalink
Correct find and replace typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ReallySmallSoftware committed Jul 25, 2020
1 parent 20bd673 commit a038d0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/android/afterPluginInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function(context) {
manifestRoot = manifest['manifest'];
packageName = manifestRoot['$']['package'];

newActivity = activity.replace('${mypackage}', packageName);
newActivity = activity.replaceAll(/\$\{mypackage\}/g, packageName);
newActivityPath = utilities.getAndroidSourcePath(context) + "/" + packageName.replaceAll("\\.", "/") + '/MainActivity.java';

console.log(newActivityPath);
Expand Down
4 changes: 2 additions & 2 deletions src/android/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public void onCreate(Bundle savedInstanceState)

FragmentManager fm = getSupportFragmentManager();

currentFragment = (CordovaFragment) fm.findFragmentByTag("${mypackage}");
currentFragment = (uk.co.reallysmall.cordova.plugin.fragment.CordovaFragment) fm.findFragmentByTag("${mypackage}");

if (currentFragment == null) {
currentFragment = new uk.co.reallysmall.cordova.plugin.fragment.CordovaFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(android.R.id.content, currentFragment,${mypackage});
ft.add(android.R.id.content, currentFragment,"${mypackage}");
ft.commit();
}
}
Expand Down

0 comments on commit a038d0d

Please sign in to comment.