-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add activity for android-specific initialization
This is work towards #23. Unfortunately, due to javafxports/android [#73](https://bitbucket.org/javafxports/android/issues/73/hardware-button-key-events-report) and [#75](https://bitbucket.org/javafxports/android/issues/75/fxactivity-does-not-call), there is no way to control volume. However, this *should* work once #75 is fixed.
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/android/java/org/gamefolk/roomfullofcats/CatsActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.gamefolk.roomfullofcats; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.media.AudioManager; | ||
import android.os.Bundle; | ||
|
||
import javafxports.android.FXActivity; | ||
|
||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Shim class that immediately passes control to FXActivity. | ||
* | ||
* We use this to perform any Android-specific initialization. | ||
*/ | ||
public class CatsActivity extends Activity { | ||
|
||
private static final Logger Log = Logger.getLogger(RoomFullOfCatsApp.class.getName()); | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
// This should work, once javafxports/android #73 and #75 are fixed. | ||
setVolumeControlStream(AudioManager.STREAM_MUSIC); | ||
|
||
Intent intent = new Intent(this, FXActivity.class); | ||
startActivity(intent); | ||
} | ||
} |