View not attached to window manager

by PaulJ » Tue, 23 Nov 2010 14:54:21 GMT


Sponsored Links
 Hello,

I'd like to ask about how to proper handle progressDialog in
Thread, since getting the error from subject.

My code:

Thread logThread = new Thread()
{
String result = new String();

@Override
public void run()
{
Looper.prepare();

try
{
result = ofsomesomeoperation();
}
catch (NoSuchAlgorithmException e)
{

}

logHandler.post(new Runnable()
{
public void run()
{
if (result.equals(something1))
{
dialogLogProg.dismiss();
showDialog(dialog_something1);
}
else
{
dialogLogProg.dismiss();
Intent newint = new Intent(Example.this,NewInt.class);
startActivity(newint);
Example.this.finish();
}
}
});
Looper.loop();
}
};
logThread.start();

Problem occurs when a dialog progress appears and I change my phone
orientation, it freezes and crashes, on line with dismiss(). I've seen
some
discussion about this but my English is poor, so I hope for some
running
examples on my code. Thank you.

Greetings.

-- 



Re: View not attached to window manager

by TreKing » Wed, 24 Nov 2010 07:08:37 GMT


 



For starters, if you use showDialog(), use dismissDialog() instead of
calling dismiss on the dialog directly.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. Only onCreate and no onRestart after startActivity ! Please Help

Hi,
its quiet urgent. I thought my project and now i found a big bug.

I have a webview and there I call an activity

  if (url.indexOf(".mp4") != -1) {
                                Intent intent = new Intent(Intent.ACTION_VIEW);
                        intent.setDataAndType(Uri.parse(url), "video/
mp4");
                        startActivity(intent);
                        return true;
                        }

The Videoplayer starts fine!

But when I click "BACK" or the Video ends... my whole Activity is
restarted with onCreate... I proofed.. and it does NOT call
onRestart!!!

So it always loads Splashscreen and all that again...

What could I do??

Thx
Chris

-- 

2. Sip voip apps for android: Is sipdroid the only joice?

Hi all! Is there anyone working on an SIP voip app for android?

I tried sipdroid app but it is still tied to pabxes.org. It's a problem 
for people trying to use this app on locally installed pabxes. It adds a 
quite high amount of delay.

Is there anyone interested in a bounty for working on sipdroid code and 
opening it to any sip provider? We could either release this on 
android/sipdroid community...

Regards, Ricardo.

-- 

3. setting spinner selection based on strings

4. Featured Apps on the market vever change!!!

5. how can resource xml will be changed in runtime..

6. Example of formatted text as an XML resource?

7. cell triangulation