versionName is 2.31, 2.4, or 3.0. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android"
- android:versionName="3.0 beta1"
- android:versionCode="35">
+ android:versionName="3.0 beta2"
+ android:versionCode="36">
<!-- We require Donut (Android 1.6) or later. -->
<uses-sdk android:minSdkVersion="4"/>
<!-- Donut-specific flags which allow us to run on large and high dpi screens. -->
@Override
public void onCreate(Bundle icicle) {
- Log.i(TAG, "Creating CaptureActivity");
super.onCreate(icicle);
Window window = getWindow();
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0, SHARE_ID, 0, R.string.menu_share).setIcon(R.drawable.share_menu_item);
- menu.add(0, HISTORY_ID, 0, R.string.menu_history).setIcon(android.R.drawable.ic_menu_recent_history);
+ menu.add(0, HISTORY_ID, 0, R.string.menu_history)
+ .setIcon(android.R.drawable.ic_menu_recent_history);
menu.add(0, SETTINGS_ID, 0, R.string.menu_settings)
.setIcon(android.R.drawable.ic_menu_preferences);
menu.add(0, HELP_ID, 0, R.string.menu_help)
* run. The easiest way to do this is to check android:versionCode from the manifest, and compare
* it to a value stored as a preference.
*/
- private void showHelpOnFirstLaunch() {
+ private boolean showHelpOnFirstLaunch() {
try {
PackageInfo info = getPackageManager().getPackageInfo(PACKAGE_NAME, 0);
int currentVersion = info.versionCode;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName(this, HelpActivity.class.getName());
startActivity(intent);
+ return true;
}
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, e);
}
+ return false;
}
/**
*/
private void initBeepSound() {
if (playBeep && mediaPlayer == null) {
+ // The volume on STREAM_SYSTEM is not adjustable, and users found it too loud,
+ // so we now play on the music stream.
+ setVolumeControlStream(AudioManager.STREAM_MUSIC);
mediaPlayer = new MediaPlayer();
- mediaPlayer.setAudioStreamType(AudioManager.STREAM_SYSTEM);
+ mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setOnCompletionListener(beepListener);
AssetFileDescriptor file = getResources().openRawResourceFd(R.raw.beep);