Groups
Sign in
Groups
CodenameOne Discussions
Conversations
Labels
About
Send feedback
Help
getInstance() of StateMachine
42 views
statemachine
Skip to first unread message
anop...@gmail.com
unread,
Dec 11, 2013, 5:51:20 AM
12/11/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com
How get an instance of the currently used StateMachine in order to use it in the native code?
I just want to use showForm("Main", null); when a TargetListener will read the content of an NFC card.
Thank you!
Shai Almog
unread,
Dec 11, 2013, 11:35:28 AM
12/11/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, anop...@gmail.com
You will need to pass an instance to that code or keep a static reference to that.
There is no standard method to get it.
anop...@gmail.com
unread,
Dec 12, 2013, 11:06:39 AM
12/12/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, anop...@gmail.com
How can I do that?
There is no way that the following happens:
public
static
StateMachine
getInstance
(){
return
this
;
}
Can you please provide me with the code?
Chen Fishbein
unread,
Dec 12, 2013, 11:36:11 AM
12/12/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, anop...@gmail.com
do this in your StateMachine:
public class StateMachine extends StateMachineBase {
private static StateMachine instance;
public StateMachine(String resFile) {
super(resFile);
instance = this;
}
public static StateMachine getInstance(){
return instance;
}
...
Reply all
Reply to author
Forward
0 new messages