[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread Mark Murphy
Nico wrote: > Hi, > I need to replace the current View (set by the activity.setContentView > method) by an other. > When I call activity.setContentView two times, I get this exception : > 01-21 14:13:54.747: WARN/System.err(1156): android.view.ViewRoot > $CalledFromWrongThreadException: Only the o

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread for android
you are probably calling from a seperate thread..after thread has done its wrk...use the handler and change the view.. On Wed, Jan 21, 2009 at 7:49 PM, Nico wrote: > > Hi, > I need to replace the current View (set by the activity.setContentView > method) by an other. > When I call activity.setCo

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread for android
i have one question around the runOnUiThread...Basically when i used this method in the onCreate/onStart of the Activity,i found that it works quite differently than i expect.. For example in the onCreate/onStart..say I have long running operation before which i want to render the UI with a progre

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread Nico
I did it : // Create a thread to change the view final Grid f_grid = grid; Runnable mainThreadRunnable = new Runnable() { public void run() { m_activity.setContentView(f_grid);

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread Mark Murphy
Nico wrote: > I did it : > > // Create a thread to change the view > final Grid f_grid = grid; > Runnable mainThreadRunnable = new Runnable() { > public void run() { > m_activity.setContentView(f_grid);

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread Nico
Thx a lot for help. On 21 jan, 16:02, Mark Murphy wrote: > Nico wrote: > > I did it : > > >            // Create a thread to change the view > >            final Grid f_grid = grid; > >            Runnable mainThreadRunnable = new Runnable() { > >                    public void run() { > >      

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread for android
any help on this ?? On Wed, Jan 21, 2009 at 8:13 PM, for android wrote: > i have one question around the runOnUiThread...Basically when i used this > method in the onCreate/onStart of the Activity,i found that it works quite > differently than i expect.. > > For example in the onCreate/onStart..

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread Romain Guy
The point of runOnUiThread() *is* to run code on the UI thread. Therefore it must NOT be used for long running operations. Usually runOnUiThread() is invoked from another thread. On Wed, Jan 21, 2009 at 7:50 PM, for android wrote: > any help on this ?? > > On Wed, Jan 21, 2009 at 8:13 PM, for an

[android-developers] Re: Replace the current view by an other view

2009-01-21 Thread for android
Oh ok..I think I understand it now.. On Thu, Jan 22, 2009 at 9:23 AM, Romain Guy wrote: > > The point of runOnUiThread() *is* to run code on the UI thread. > Therefore it must NOT be used for long running operations. Usually > runOnUiThread() is invoked from another thread. > > On Wed, Jan 21, 2