2014년 12월 9일 화요일

help with notifier component

 want a notifier to be displayed when the screen is initialized for the first time but when it is dismissed the notifier component should be disabled when the screen is initialized for the second time. is there any way to do it? Please help :)



Certainly! You have to keep track of the first time or not (or keep track of however many times the screen is initialized) run by using the TinyDB component. It'll be a pain to test because you'll have to either uninstall the app to reset it or build in a reset then take it out for production.
At the beginning of the Screen Initialized even do a GetTag. Look for a tag called 'InitializedOnce' and set the valueIfTagNotThere to False. Test your result and if it's False do your notifier code. 
Do a StoreValue at the end of the Screen Initialized event.  Store True to the tag 'InitializedOnce'    

You can get more fancy and set the valueIfTagNotThere to 1, Check for < 2 or maybe check if it's a multiple of 10 or 20 to do the notifier, Add one to the result when you store it. 



Thank you for the method but it is still not clear to me. A block representation will certainly help me out. 



It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.



This is the idea.  You could flip the logic over or store a value instead of a simple boolean. The ClearAll makes sure the tinyDB is empty for testing purposes.


댓글 없음:

댓글 쓰기