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. Porting Android to the I8910 Omap 3430

After reading bits and pieces here and there I was wondering if it is
possible to port android to the Samsung Acme (I8910). The device is
powered by a speedy Omap 3430 CPU together with a Qualcomm MSM62xx.

I have already seen the Omap 3430 based ports of android but is is
possible to use any of these ports on the Acme? Currently the Acme
uses the S60 5th edition operating system.

My guess is you have to flash a new bootloader to the I8910 and then
load a omap3 compiled linux kernel form where to boot linux. The I8910
has no keypad so the omap3 compiled version of the linux kernel should
support the touchscreen.

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. asterisk in layout file

I noticed that in Android source code, layout file, there are 2 ways
to reference a resource, could someone tell me what's the difference?

android:icon="@*android:drawable/ic_menu_stop"
android:icon="@android:drawable/ic_menu_recent_history"

--~--~---------~--~----~------------~-------~--~----~

3. Looking for testers for Windows Live Sync app

4. Adding a bluetooth printer

5. localized european movie trailers available to Android Developers

6. IM application on Android cupcake emulator

7. isFirst on cursor is not returning false each time!!!!!!!!!!!!!!!