Option to clean up SDL config left from the old app version

This commit is contained in:
pelya
2011-11-16 17:30:29 +02:00
parent d5313cb08e
commit 90014495ee
5 changed files with 65 additions and 9 deletions

View File

@@ -62,8 +62,8 @@ import java.io.BufferedReader;
import java.io.BufferedInputStream;
import java.io.InputStreamReader;
import android.view.inputmethod.InputMethodManager;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
public class MainActivity extends Activity {
@Override
@@ -664,6 +664,17 @@ public class MainActivity extends Activity {
};
public int getApplicationVersion()
{
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
return packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) {
System.out.println("libSDL: Cannot get the version of our own package: " + e);
}
return 0;
}
public FrameLayout getVideoLayout() { return _videoLayout; }
static int NOTIFY_ID = 12367098; // Random ID