If I just want to start a service, It is not needed to display an UI

On 22 abr, 14:27, "Dan U." <[EMAIL PROTECTED]> wrote:
> I'm not sure why you would want an extraActivitythat you would never
> see. Really, you only need the login screen and then choose whether to
> display it or forward to the main screen based upon thecurrentlogin
> state. It might be similar to a chain of responsibility design
> pattern. The user would always select the apps icon which always goes
> to the loginactivity. It doesn't mean it always shows the loginactivity. You 
> just have to handle the situation that you are already
> logged in, in your code.
>
> On Apr 22, 9:45 am, André Oriani <[EMAIL PROTECTED]> wrote:
>
> > Can I use aActivitythat does not display nothing, ie, no calls to
> > setContentView and make it manage whatactivityshall be displayed?
> > I will have a service running while user is logged in. So  my
> > application will be running "forever" until I stop the service. While
> > the service is running, will Android drop the stack of activities?
>
> > Example.
>
> > User logs in , I start the service, switch to contact list actvity
> > ( calling finish() on login) . The user press back or home key to get
> > back to idle. When user selects the application again by clicking on
> > my app's icon, will it always display the contact list or will it show
> > the contact list(ie, the UI stack was dropped, restarting UI again) ?
>
> > Thanks,
> > André Oriani
>
> > On 21 abr, 22:44, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > > I think the intention is that a login screenactivitywill always be
> > > launched. You should be able to just check to see if the user is
> > > logged in inside the onCreate of the loginactivity, then forward to
> > > the mainactivity(and I think make a finish() call in the login
> > >activity) if they are logged in, else continue to display the login
> > >activity.
>
> > > On Apr 21, 6:23 pm, André Oriani <[EMAIL PROTECTED]> wrote:
>
> > > > Manmath,
>
> > > > Are you talking about using anActivityto 2 views?
>
> > > > hackbod,
>
> > > > But when user clicks on the app icon, theActivityfor login screen
> > > > will always be launched, am I right ?
> > > > And did you mean  ApiDemos/src/com/google/android/samples/app/
> > > > Forwarding.java ?
>
> > > > Thanks,
> > > > André
>
> > > > On 21 abr, 02:14, Manmath <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi André,
>
> > > > > The answers are as follows :
> > > > > Ans 1: Use Prefs file to store a boolean value for user logged in
> > > > > status. You can put the following condition on the onCreate().
> > > > >       If(user logged in ) then show list.
> > > > >       else show login screen.
> > > > > Ans 2: I am agreed with hackbod. You need to  finish the Login
> > > > >activityas soon as your login is completed.
>
> > > > > Regards
> > > > > Manmath
>
> > > > > On Apr 21, 9:25 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > The typical way for you to do this is to have the login screen check
> > > > > > to see if it needs to login and, if not, call startActivity()
> > > > > > immediately to display the "real" main screen of the app.  In both 
> > > > > > the
> > > > > > login and no login cases, call finish() immediately after
> > > > > > startActivity() so the user can't navigate back to the login screen.
>
> > > > > > In the ApiDemosactivitysection you will find an example that does
> > > > > > this, though I don't recall off-hand what it is called.
>
> > > > > > On Apr 20, 8:24 pm, André Oriani <[EMAIL PROTECTED]> wrote:> Hi all,
>
> > > > > > > I am working on a Instant Messaging Application.  Okay, The
> > > > > > > applications starts with a login screen that asks for username and
> > > > > > > password. When login key is pressed  I start a subactivity to 
> > > > > > > show the
> > > > > > > contact list.
>
> > > > > > > I see 2 potential problems here;
>
> > > > > > > 1)When user leaves the application, it is still running ( i've
> > > > > > > implemented a service). When user go to Apps folders and selects 
> > > > > > > my
> > > > > > > app. I want it to show the contact list, not to display the login
> > > > > > > screen again
>
> > > > > > > 2) if in the account list the user press back key , the app will
> > > > > > > return to login screen and not to home screen
>
> > > > > > > Any tips or advices to solve these situations?
>
> > > > > > > Tks,
> > > > > > > André
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to