@@ -65,11 +65,16 @@ private void createOnReceive() {
6565 onReceiveBody = onReceiveMethod .body ();
6666 onReceiveBody .invoke (getInit ()).arg (onReceiveContext );
6767 onReceiveBody .invoke (JExpr ._super (), onReceiveMethod ).arg (onReceiveContext ).arg (onReceiveIntent );
68+ }
69+
70+ private void setOnReceiveIntentAction () {
71+ JInvocation getActionInvocation = JExpr .invoke (getOnReceiveIntent (), "getAction" );
72+ onReceiveIntentAction = getOnReceiveBody ().decl (classes ().STRING , "action" , getActionInvocation );
73+ }
6874
69- JInvocation getActionInvocation = JExpr .invoke (onReceiveIntent , "getAction" );
70- JInvocation getDataSchemeInvocation = JExpr .invoke (onReceiveIntent , "getScheme" );
71- onReceiveIntentAction = onReceiveBody .decl (classes ().STRING , "action" , getActionInvocation );
72- onReceiveIntentDataScheme = onReceiveBody .decl (classes ().STRING , "dataScheme" , getDataSchemeInvocation );
75+ private void setOnReceiveIntentDataScheme () {
76+ JInvocation getDataSchemeInvocation = JExpr .invoke (getOnReceiveIntent (), "getScheme" );
77+ onReceiveIntentDataScheme = getOnReceiveBody ().decl (classes ().STRING , "dataScheme" , getDataSchemeInvocation );
7378 }
7479
7580 public JMethod getOnReceiveMethod () {
@@ -102,14 +107,14 @@ public JVar getOnReceiveContext() {
102107
103108 public JVar getOnReceiveIntentAction () {
104109 if (onReceiveIntentAction == null ) {
105- createOnReceive ();
110+ setOnReceiveIntentAction ();
106111 }
107112 return onReceiveIntentAction ;
108113 }
109114
110115 public JVar getOnReceiveIntentDataScheme () {
111116 if (onReceiveIntentDataScheme == null ) {
112- createOnReceive ();
117+ setOnReceiveIntentDataScheme ();
113118 }
114119 return onReceiveIntentDataScheme ;
115120 }
0 commit comments