[android-developers] Looper.prepare() question

2010-09-27 Thread Kakyoin
Hi. I'm trying to initialize OpenFeint in my game like this: - protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); OpenFeintSettings settings = new OpenFeintSettings("xxx", "xxx",

Re: [android-developers] Looper.prepare() question

2010-09-27 Thread Agus
Try this: create handler as member variable of your activity; private Handler h = new Handler(); and then in the onCreate method: h.post( new Runnable(){ } ); On Mon, Sep 27, 2010 at 9:38 AM, Kakyoin wrote: > Hi. > > I'm trying to initialize OpenFeint in my game like this: >

Re: [android-developers] Looper.prepare() question

2010-09-27 Thread Agus
Sorry last solution sent you is wrong since the handler was instantiated in the UI thread, here's the correct one: create a subclass MyThread like this: class MyThread extends Thread{ public Handler h; private CountDo

Re: [android-developers] Looper.prepare() question

2010-09-27 Thread Agus
class MyThread extends Thread{ public Handler h; private CountDownLatch wait = new CountDownLatch(1); @Override public void run() { Looper.prepare();

Re: [android-developers] Looper.prepare() question

2010-09-28 Thread chetan achar
hi, The problem with this is ur trying to do some manipulations in the thread which is not allowed hence create a handler and just pass an empty message from th thread to the handler, where u can write ur code. Thus avoiding the exception of looper.prepare() -- You received this message because