From: Christian Weiske Date: Sat, 12 Sep 2015 20:50:42 +0000 (+0200) Subject: use a method to make it overridable X-Git-Url: https://git.cweiske.de/ouya-romlauncher.git/commitdiff_plain/c3c08eda36fa27744db0d0e3221818d8be5b6ba8 use a method to make it overridable --- diff --git a/.gitignore b/.gitignore index 082c52d..026c201 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /.classpath /.project /.settings +/local.properties +/src/romlauncher/ diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 138cdfd..c797e5e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,13 +1,13 @@ - - + diff --git a/src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java b/src/de/cweiske/ouya/romlauncher/LaunchSnesActivity.java similarity index 69% rename from src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java rename to src/de/cweiske/ouya/romlauncher/LaunchSnesActivity.java index 085b5e9..a9941b8 100644 --- a/src/de/cweiske/ouya/gamelauncher/LaunchGameActivity.java +++ b/src/de/cweiske/ouya/romlauncher/LaunchSnesActivity.java @@ -1,20 +1,4 @@ -/* - * Copyright (C) 2012 OUYA, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package de.cweiske.ouya.gamelauncher; +package de.cweiske.ouya.romlauncher; import java.io.File; import java.io.FileOutputStream; @@ -30,10 +14,10 @@ import android.net.Uri; import android.os.Bundle; import android.os.Environment; -public class LaunchGameActivity extends Activity +abstract public class LaunchSnesActivity extends Activity { - String assetFilename = "FIXME_ASSETFILENAME"; - + abstract protected String getAssetFilename(); + /** * Called when the activity is first created. */ @@ -42,9 +26,9 @@ public class LaunchGameActivity extends Activity { super.onCreate(savedInstanceState); - File extractedFile = extractFile(this.assetFilename); + File extractedFile = extractFile(getAssetFilename()); if (extractedFile == null) { - System.err.println("Failed to extract file " + this.assetFilename); + System.err.println("Failed to extract file " + getAssetFilename()); finish(); return; }