Permalink
Browse files

(#648) Added preOnStartCommand and preOnBind; condition preOnCreate t…

…o only function if not using RubotoService
  • Loading branch information...
1 parent a117a92 commit 92db1912dc2e94670b5fa5b8d59522b015d35c4e @rscottm rscottm committed Jul 21, 2014
Showing with 18 additions and 2 deletions.
  1. +18 −2 assets/src/RubotoService.java
@@ -9,8 +9,24 @@
* Called at the start of onCreate() to prepare the Activity.
*/
private void preOnCreate() {
- System.out.println("RubotoService onCreate(): " + getClass().getName());
- getScriptInfo().setRubyClassName(getClass().getSimpleName());
+ if (!getClass().getSimpleName().equals("RubotoService")) {
+ System.out.println("RubotoService onCreate(): " + getClass().getName());
+ getScriptInfo().setRubyClassName(getClass().getSimpleName());
+ }
+ }
+
+ private void preOnStartCommand(android.content.Intent intent) {
+ if (getClass().getSimpleName().equals("RubotoService")) {
+ System.out.println("RubotoService onStartCommand(): " + getClass().getName());
+ scriptInfo.setFromIntent(intent);
+ }
+ }
+
+ private void preOnBind(android.content.Intent intent) {
+ if (getClass().getSimpleName().equals("RubotoService")) {
+ System.out.println("RubotoService onBind(): " + getClass().getName());
+ scriptInfo.setFromIntent(intent);
+ }
}
THE_METHODS

0 comments on commit 92db191

Please sign in to comment.