import android.app.Activity;
import android.app.AlertDialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
requestWindowFeature(Window.FEATURE_NO_TITLE);
- //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- // WindowManager.LayoutParams.FLAG_FULLSCREEN);
view = ShisenSho.app().getView();
ShisenSho.app().activity = this;
case R.id.undo:
case R.id.clean:
return view.onOptionsItemSelected(item);
+ case R.id.hiscore:
+ startActivity(new Intent("de.cwde.freeshisen.HISCORE", null));
+ return true;
case R.id.options:
- startActivityForResult(new Intent("de.cwde.freeshisen.SETTINGS", null), 0);
+ startActivity(new Intent("de.cwde.freeshisen.SETTINGS", null));
return true;
case R.id.about:
onAboutActivate();
PackageInfo pInfo;
try {
pInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_META_DATA);
- String aboutTitle = String.format("About %s", getString(R.string.app_name));
- String versionString = String.format("Version: %s", pInfo.versionName);
+ String appname = getString(R.string.app_name);
+ String aboutTitle = "About " + appname;
+ String versionString = appname + " "+ pInfo.versionName;
String aboutText = getString(R.string.aboutText);
// Set up the TextView
// Set some padding
message.setPadding(5, 5, 5, 5);
// Set up the final string
- message.setText(versionString + "\n" + s);
+ message.setText(versionString + s);
// Now linkify the text
Linkify.addLinks(message, Linkify.ALL);
.setTitle(aboutTitle)
.setCancelable(true)
.setIcon(R.drawable.icon)
- .setPositiveButton(getString(android.R.string.ok), null)
+ .setPositiveButton(android.R.string.ok, null)
.setView(message).create()
.show();
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
+
+ public void onOptionsChanged()
+ {
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.prefchange_confirm_title)
+ .setCancelable(true)
+ .setIcon(R.drawable.icon)
+ .setPositiveButton(android.R.string.yes,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ // User clicked OK button - reset game
+ view.reset();
+ }
+ })
+ .setNegativeButton(android.R.string.no, null)
+ .setMessage(R.string.prefchange_confirm_text)
+ .create()
+ .show();
+ }
}