Skip to content

Commit

Permalink
Update UAAL example to support Gradle 8 in 2023.3.0b7+
Browse files Browse the repository at this point in the history
  • Loading branch information
manugildev committed Feb 12, 2024
1 parent b415794 commit 3c979e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions NativeAndroidApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {


android {
namespace "com.unity.mynativeapp"
compileSdkVersion 33

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,21 @@ public void onClickShowUnity(View v) {
isGameActivity = !(v.getId() == R.id.show_unity_button);
disableShowUnityButtons();

Intent intent;
switch (v.getId()) {
case R.id.show_unity_button:
intent = new Intent(this, getMainUnityActivityClass());
break;

case R.id.show_unity_game_button:
intent = new Intent(this, getMainUnityGameActivityClass());
break;

default:
return;
int id = v.getId();
if (id == R.id.show_unity_button) {
startUnityWithClass(getMainUnityActivityClass());
} else if (id == R.id.show_unity_game_button) {
startUnityWithClass(getMainUnityGameActivityClass());
}
}

private void startUnityWithClass(Class klass)
{
Intent intent = new Intent(this, klass);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivityForResult(intent, 1);
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Expand Down

0 comments on commit 3c979e6

Please sign in to comment.