duh - that should be

                boolean hasSeenUpdateVersion = settings.getBoolean(
                                "hasSeenUpdateVersion" + vc, false);

of course :)

On Jun 26, 6:08 pm, Anna PS <[email protected]> wrote:
> Thank you - good thinking.
>
> For the benefit of others reading, this is how I did it in the end:
>
>                 String vc = null;
>                 try {
>                         vc = 
> getPackageManager().getPackageInfo(getPackageName(),
> 0).versionName;
>                 } catch (NameNotFoundException e)
>                         e.printStackTrace();
>                 }
>                 boolean hasSeenUpdateVersion = settings.getBoolean(
>                                 "hasSeenUpdateVersion", false);
>                 if (!hasSeenUpdateVersion) {
>                         // show a dialog here
>                         SharedPreferences.Editor editor = settings.edit();
>                         editor.putBoolean("hasSeenUpdateVersion" + vc, true);
>                         editor.commit();
>                 }
>
> On Jun 26, 1:54 pm, Neil <[email protected]> wrote:
>
>
>
> > The way you suggested, but add versionCode to the setting name.
>
> > On Jun 26, 12:40 pm, Anna PS <[email protected]> wrote:
>
> > > Actually, I have realised that won't work, because it will also show
> > > the first time the app is installed. It should only show uponupdate.
>
> > > So, the question still stands. How can I check whether a user has just
> > > installed anupdate, in order to show anupdatemessage?
>
> > > Any ideas anyone?
>
> > > Thanks,
> > > Anna
>
> > > On Jun 25, 5:17 pm, Anna PS <[email protected]> wrote:
>
> > > > Hi all,
>
> > > > I want to show anupdatemessagefor a new release - the first time
> > > > the user opens the updated version of my app, a pop-up dialog should
> > > > appear, saying what's new, with an OK button. After the user has read
> > > > it once, it shouldn't appear again.
>
> > > > Is there any inbuilt Android variable I can check to see whether the
> > > > user has opened the app before?
>
> > > > Of course, I can define my own boolean in the app settings
> > > > ("hasUserSeenUpdateMessage") to check each time the app runs - setting
> > > > it to false initially, and then true when the user clicks OK.
>
> > > > Just wondered if there was a slightly more sophisticated way of doing
> > > > it, or if that's the way to go :)
>
> > > > thanks!
> > > > Anna
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to