Call fucntion on App load only once

Hi
I call a Windows live SDK logon function, GreetUser(); when the apps loads on start-up as below. If I navigate to another page then back again the logon calls again.
How can I make it call the function only once?
public sealed partial class GroupedPicturesPage : LayoutAwarePage
public GroupedPicturesPage()
this.InitializeComponent();
GreetUser();

I'm sure a real programmer would use something more sophisticated. I am a fake programmer. So, I use very simplistic solutions for this kind of thing.
In the App.xaml.cs page, create a static bool variable.  This will be your app global variable.  Initialize it to true. 
static public bool firsttime = true;
Now, in the page that you posted the code from, modify it to this.
public sealed partial class GroupedPicturesPage : LayoutAwarePage
public GroupedPicturesPage()
this.InitializeComponent();
if(firsttime==true) {
GreetUser();
App.firsttime = false;
And voila.  GreetUser() will only fire the first time around.  After that, it won't fire again.

Similar Messages

  • Allow an application to load only once?

    Sorry if this question has already been answered but I would like to know if it is possible to allow an app to be loaded only once so that multiple instances of the program cannnot be started, ergo messing up data files ina a fashion I'd like to avoid.
    Thanks.

    Sorry that was the wrong thread
    On a brighter note - an idea 4 u
    1. Write to a text file and give it a value eg "1" which will be on the server if it's a web app thrfr safe. If it's local then some jolly clever person may delete it + that's you n ur hard wk all in ... I'll stop wittering + continue;-
    2. When your app starts it looks for reads the file eg "Start.txt"
    3. if(fileExists() ...is one way
    4. Or it can read the value - if(startTxt.equals() - may give you the flexibility to reset the value to eg "0" + allow ... whatever
    5. I might be talking cr*p here, but hey, this is a forum, tell someone who gives a damn

  • App works ONLY ONCE

    I am trying to deploy my swt app using JWS...
    Everything works fine the first time I download and launch the app...
    But it works ONLY ONCE.... when I start it again I get this exception:
    java.lang.NullPointerException
         at com.sun.javaws.security.SigningInfo.verifyAllEntriesSigned(Unknown Source)
         at com.sun.javaws.security.SigningInfo.checkSigning(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
         at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
         at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
         at com.sun.javaws.Launcher.launch(Unknown Source)
         at com.sun.javaws.Main.launchApp(Unknown Source)
         at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
         at com.sun.javaws.Main$1.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    this is my JNLP file
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0+" codebase="http://192.168.50.34:8080/Application" href="MyApp-win.jnlp" main="true">
    <information>
    <title>Application</title>
    <vendor>#######</vendor>
    <homepage href="index.html"/>
    <description>Application</description>
    <description kind="short">Siglaror</description>
    <offline-allowed/>
    <shortcut online="true">
    <desktop/>
    <menu submenu="App"/>
    </shortcut>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="MyApp-win.jar"/>
    <jar href="installer.jar"/>
    </resources>
    <application-desc main-class="it.swt.MenuIniziale"/>
    </jnlp>
    I hope someone have some idea.. it's driving me completely crazy :-(
    thank you in advance

    You may be using some third party jars which are already signed. Use extension tag to load those jars
    also check this thread if you can find any ideas
    http://forum.java.sun.com/thread.jspa?threadID=275890&messageID=1305431
    I notices there is main attribute in your jnlp tag. which should not be there
    <jnlp spec="1.0+" codebase="http://192.168.50.34:8080/Application" href="MyApp-win.jnlp" main="true">

  • IOS7- Launching phone app after call or voicemail - app loads empty screen

    This has happened 3 times now. I'll get a phonecall, usually they will leave a voice mail. So I click ont he phone icon, app launches, you see the white background load, then it's gone and I see my wallpaper and app is crashed. Nothing happens. I have to quit the app and relaunch to get it working again.

    The lockscreen notification issue is with only 1 game in particular I think. Adding, my iOS install is a clean install because it didn't restore data for a few of my games when I upgraded to iOS7 in the first place. So I had to erase all and install after a restore didn't work correctly.
    I haven't updated to 7.0.4 since that is mainly for facetime, but I'll update to that and see if anything happens. I'm nervous to do a restore and lose my game data again. But that is a logical next step to try so thanks for the suggestion. I just hope I don't have to.

  • Load swf once in all scene  (AS2)

    hello ,
    i have flash with 3 scene .
    i load a external swf in movie clip in scene 1 .
    but when i go to next scene external swf load again .
    i don't want it load again , it's load in scene 1 .
    please HELP .

    i'm sorry we have a miss undrestanding .
    i don't want to remove the movie clip ,  but i don't want it to load again , you know , you have to load external swf ( size 300 KB ) in scene 1 , and wait to load , and when you go to next scene it's load again and you must wait again , i mean what's the way that it load only once for all scene ?

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Can we restrict a Procedure to be called only once in a session or package?

    Hi,
    I am having a procedure which is called for each insert statement.
    The code is non-Editable.
    So, I want to restrict the procedure to be called only once for the entire session or package.
    Could any one please suggest me, can we do this?
    Thak you,
    Regards,
    Gowtham Sen.

    Hi,
    Actually, I am using OWB tool. I used a procedure with output parameters, to map to the target table. So, OWB creates a package. In that package its calling the procedure for each record.
    So, in order to avoid that, can I do any thing else, which would restrict it to call for each record.
    Thank you,
    Regards,
    Gowtham Sen.

  • I think there is a flaw in ios 5. Notification centre doesn't show missed call, during another call is in progress, after accessing recent calls in phone app, once.

    Notification centre in ios 5 is not showing the missed calls when another call is in progress. It shows perfectly before accessing the phone app. But once you access the recent calls in phone app, then afterwards it stops showing the missed calls during another call is in progress.

    Forgot to add, this happens, when you receive a call, during the phone is locked, and you receive a call, while the previous call is in progress.

  • Call JCO.ParameterList.setActive() only once?

    In a loop construct where I am calling a JCO.Function over and over again, do I need to call setActive() on the export parameter list and the table parameter list only once to render unnecessary parameters inactive or do I have to do it on each iteration?  Please refer to the code example below:
    void processFunction(JCO.Client connection, String fxName) {
    JCO.Function fx = createFx(fxName);  // some helper method
    JCO.ParameterList epl = fx.getExportParameterList();
    JCO.ParameterList tpl = fx.getTableParameterList();
    deactivateExportParameters(epl);  // Deactive here?
    deactivateTableParameters(tpl);    // Deactive here?
    for (int i = 0; i < count; i++) {
       deactivateExportParameters(epl);  // or here?
       deactivateTableParameters(tpl);    // or here?
       setImportParameters(fx);  // helper method
       connection.execute(fx);
       processResults(fx);  // helper method
    The methods deactivateExportParameters() and deactivateTableParameters() both
    call JCO.ParameterList.setActive() to inactivate export parameters or table parameters
    based on whether they are referred to after the JCO.Function is executed.
    Thanks in advance.
    Message was edited by:
            Jim OHearn
    Message was edited by:
            Jim OHearn
    Message was edited by:
            Jim OHearn

    Hi Jim,
    the setActive method needs to be called only once. It is fired when the Function is created (either called from the Repository or created anew).
    When you want to use the function, call the setActive method before the for loop. If you had been actually creating the functions inside the loop, then you need to call the setActive method also in the loop.
    For e.g -
    JCO.Function fx;
    ParameterList tableParamList;
    for(int looper = 0; looper < 10; looper++)
              fx = createFunction("BAPI_NAME");
              tableParamList = fx.getTableParamList();
              tableParamList.setActive(false, "TABLE_NAME");
    Bye,
    Sameer

  • Pls give me the code to load method only once in JVM.

    Hi all,
    Pls give me the code to execute method only once in JVM.Even if we create more than one instance to call the method.
    Thanks & Regards,
    Vinodh

    [How to ask a question on these forums|http://catb.org/~esr/faqs/smart-questions.html]

  • Start routine: only once per teh load but not once per data packet

    Hi,
    I would like to execute some code in start routine (in update rules) only once per the load but not once per the data packet.
    How can I implement this.
    Regards,

    I once had that same requirement, but in a datasource in R3. I'm not sure if the same solution would work in BW, though. I used a memory id to keep the variable value between packets:
    DATA: ... n_globalvar TYPE n ...
    then I added...
    IMPORT n_globalvar FROM MEMORY ID 'ZMEMID01'.
    ...at the start of the routine to retrieve to the variable the value from the memory id.
    At the end of the code, I exported the variable back to the same memory id...
    EXPORT n_globalvar to MEMORY ID 'ZMEMID01'.

  • What method is called only once in the life cycle?

    Hello,
    What method is called only once in the life cycle of an Entity Bean and Session Bean?
    Is it ejbRemove()?
    Thanks

    hi,
    ejbCreate() and setSessionContext() are called once by the container after the bean instace is created.when the bean instance goes to pool and again return to ready state to handle client requests these methods r never called .only bussiness methods r called.this is in case of stateless session bean.
    in case of stateful session bean, each bean instance is associated with client.so,when new client requests, new bean instance is created and above 2 methods are called. no pool terminology in case of stateful session bean.
    ejbRemove() is called by the container when it is abt to remove bean instance,so it its obvious tht it is called only once.

  • Custom Render service is called only once, why?

    Hi All,
    I've created a custom render service in order to prepopulate principals name on each step of my process.
    The input form of the process is a Document Form cause users attach files to the form and it is routed to next station with the attachments.
    "Call Render Service only once" checkbox in advanced settings is unchecked.
    When the process is initiated my custom render is invoked fine, but when it reaches the assign task activity the form is opened but no render service is invoked.
    Why is it happens?
    Thanks in advance, Yan.

    Hi Parth,
    I'm writing to the log file every time that my custom service is invoked.
    When I open a form for a first time in workspace I see that it was invoked but when it reaches "assign task" activity and opened again the service is not invoked.
    I have only one form variable.
    Yan.

  • I want to switch between 2 open apps using only 1 step, i.e. touch once, tap once, push once, swipe once, etc. Can I do this with a 4s running 6.1.3?

    I want to switch between 2 open apps using only 1 step, i.e. touch once, tap once, push once, swipe once, etc. Can I do this with a 4s running 6.1.3?

    No.  2 steps if the app is already open, double tap the home button and then tap on the app.

  • Is there any solution to make getter called only once?

    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advance

    debdutta wrote:
    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advanceTake whatever you need out of the getter method(s) and put it in the constructor method of your bean. Then it only get called once. The getter method should only return the value and nothing else i.e. no database calls, calculations or anything else.
    Off topic, perhaps a sticky thread for this topic should be created as I see it being asked numerous times in the last four months.

Maybe you are looking for

  • Iphone not showing up in Iphoto-08

    The only problem I am having is when I open up iphoto and plug in my iphone it does not show up. I can not import my images. Itunes is fine. Dont want to restore my phone, and I can email the images but thats not what I use to be able to do. Just hap

  • Can't add music. Can't restore. Error messages galore.

    A few weeks ago my husband plugged in his iPod Classic 160GB into my iBook. It began to sync music, as per usual. After a short time there was an error message basically saying it couldn't sync "cannot create/read/write" or something to that effect (

  • Blue screen with rotating gear

    I have installed a new hard drive in a mac mini PPC. When I try to install OS X from the original disk, I get as far as the language selection screen and then it goes to a blue screen with a rotating gear. I have left it there for an hour and nothing

  • How to connect meter to o/p of extract single tone information

    plz tell me how to do this....    thanks in advance

  • Process Scheduler - App Engine Help.

    We are trying to run an application engine program that produces a simple report as an excel file (.XLS), in the process scheduler when running the program and selecting type EMAIL and format as XLS we are running into some issues. The report gets em