lifecycle

Does pressing Back always cause Activity to finish()?

I've heard that pressing the back button will essentially cause the current Activity to finish(). Is this always the case? Seems like it would be with the way it pops the Activity off the stack. The one situation I'm not so sure about is when the root Activity in a Task has back pressed. I'm currently experiencing a very weird effect, d...

JSF 2 f:ajax lifecycle problem

The problem is, that if a property is changed during an f:ajax request and a binded panelGroup should be newly created depending on that changed value, the old value is used. This code will explain the problem. Here is the backingbean TestBean: public String getFirst() { return first; } public void setFirst(String firs...

A company that had a successful product but went bust for not innovating?

At the company that I work we have a successful software product that did well but is now obsolete and unmaintainable. I am trying to explain that you need to innovate and replace this product with new offering in order to survive. I am looking for some good examples of companies that made the mistake that we are close to making - relyin...

Hibernate entities stored as HttpSession attribute values

I'm dealing with a legacy Java application with a large, fairly messy codebase. There's a fairly standard 'User' object that gets stored in the HttpSession between requests, so the servlets do stuff like this at the top: HttpSession session = request.getSession(true); User user = (User)session.getAttribute("User"); The old user authe...

How to track deleted self-tracking entities in ObservableCollection without memory leaks

In our multi-tier business application we have ObservableCollections of Self-Tracking Entities that are returned from service calls. The idea is we want to be able to get entities, add, update and remove them from the collection client side, and then send these changes to the server side, where they will be persisted to the database. S...

Call method in EJB on JBoss startup

Hello, I'm looking for an entry point in an EJB deployed on JBoss. Servlets have the load-on-startup tag to use in its web.xml. I'm searching for similar init() functionality for an EJB. ...

Question about the lifecycle of a simple Android application

Hi, I've got a simple application with 3 activities: -the first contains a search box which calls a web service and show the results (restaurants) below in a listview -when a restaurant is clicked another activity is started showing the description of the restaurant and a button "show map" -when the button "show map" is clicked, guess w...

Android - Where to store generated bitmaps?

I've got an app which dynamically generates anywhere from 6 to 100 small bitmaps for the user to move around the screen in a given session. I currently generate them in onCreate and store them to the sd card, so that after an orientation change I can grab them out of external storage and display them again. However, this takes time (th...

Looking into the Android source, specifically around activity & service lifecycle

I want to look more into the workings of Android. More specifically I want to know how Applications (including Activities and Services) get launched by the system. I also want to be able to see who calls their lifecycle methods and how objects get allocated and recycled. I have downloaded the Android source from git and browsed around f...

OSGi equinox : Bundle stay always in the state "RESOLVED"

Hello, I've created one main bundle in wich one I've installed the equinox p2. Then I export it to obtain an executable. My executable works correctly. I've also created one other Bundle that interact witt the first one. In eclipse, if I create a product configuration with this 2 bundles and run the product, everything works. After tha...

When to Bind and UnBind to a LocalService from an Activity

Currently, I'm binding to a service in the onCreate() method of an Activity and unbinding in the onDestroy() method of the Activity. I've more than one activity binding to the same service. Am I using the correct lifecycle methods to bind and unbind? Thanks. ...

Scope of static objects in ASP.NET

Hi all I've just read this thread which discusses code to create an NHibernate SessionFactory object statically from a helper class: http://stackoverflow.com/questions/2362195/ensure-nhibernate-sessionfactory-is-only-created-once What is the lifecyle of a static member variable in an ASP.NET application? Does it exist as long as the w...

Show error within JSF page and continue rendering it instead of redirecting to separate error page

Whenever there is an error during the load of a JSF facelet, JSF stops rendering the page at the point of the error and shows the error page instead (default behavior). I want JSF to continue rendering a page instead and show the exception/error within the page. For example if the page is loading a "portlet", which throws an exception, t...

All @Resource injection before any @PostConstruct again.

JSR-250 says all @Resource annotated methods will be called before the @PostConstruct method.. My question is: Does that mean that all @Resource annotated methods on all beans in a context will be called before any @PostConstruct annotated methods are called? Or in other words can a beans @PostConstruct method be called once its depend...

Activity Lifecycle: startActivityForResult and press Back Button

Is there a method of the Activity lifecycle which is called if the user presses the back button, but not if the the method startActivityForResult() is called? I couldn't find a method by testing it. ...

How to check if my activity is the current activity running in the screen.

I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started. I want to check this situation, when the activity is not the current one, I'd not send the Toast notification. But how to do ? ...

Android: Lifecycle problem - leaving the application

Hi, The first activity in my app is a splash screen with a Progress Dialog in which I load data from a Web Service. When this is done I start the next activity and call finish() in the first activity's onPause(), in order for it to not appear again. The next activity is my main menu and on from there I browse the application. The proble...

Application_Start versus OnInit versus constructor

I've gone rounds with this ever since I started programming classic ASP 12 (or so) years ago and I've never found a great solution because the architecture of ASP and ASP.NET has always been a swamp of bad practices, magic shared singletons, etc. My biggest issue is with the HttpApplication object with its non-event events (Application_S...

Keeping a bitmap in memory with the help of onRetainNonConfigurationInstance()

I have a large bitmap that i would like to keep in memory when the qwerty keyboard is visible. My app is always in landscape, so this is the only configuration change that will cause a reDraw. I heard this is what onRetainNonConfigurationinstance() is for...but cant figure it out. Can someone point me in the right direction? Thanks. ...

Problems understanding the life cycle when screen goes off and on

Hi, Information: My device is a Nexus One with 2.2 and I have tested two projects, one on 1.5 and one on 2.1. Problem: I have trouble to understand the life cycle of my application when the screen is turned off and on. Here is my output // activity starts 08-04 17:24:17.643: ERROR/PlayActivity(6215): onStart executes ... 08-04 17:24:...