**** BEGIN LOGGING AT Sat Feb 14 02:59:57 2009 Feb 14 03:19:52 hah! Figured it out. I bet this is the same problem a lot of people have with orientation changes on progress dialogs. Feb 14 03:20:48 After debugging and watching the allocation balance of the creation and dismissal of the dialog, it turns out that if you show the dialog in your onCreate, you leak a window Feb 14 03:21:06 The framework will create the dialog for you when the orientation changes, so if you try to create, you lose the first one Feb 14 03:21:26 So the solution is to store something off in the saveInstance and detect it in the onCreate. Feb 14 03:21:39 If you detect that you're being restored, don't try to create the progress dialog. Feb 14 03:26:04 So a context leak? Feb 14 03:26:45 window leak Feb 14 03:27:03 E/WindowManager( 1620): android.view.WindowLeaked: Activity com.ryanSteckler.buzzMe.serviceAndroid.ChooseAlertActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43401b80 that was originally added here Feb 14 03:27:33 Because I was creating it in onCreateDialog, and then the framework would come along right after me and call onCreateDialog again. Feb 14 03:28:25 googling shows lots of people with the problem, but I thikn what was lost between their code and that in the framework is that the framework always calls the progress dialog from a button click, etc. Not from the onCreate. Feb 14 03:28:47 hmm Feb 14 04:25:45 sweet .. my app turns on airplane mode when it starts and turns off when it quits Feb 14 04:28:19 next step is to figure out how to play music as a service :P Feb 14 05:06:08 DJTachyon: triggering airplane mode seems... excessive? Feb 14 05:25:27 Yeah, what if I want to use my phone as a phone? Feb 14 11:35:00 hey, has System.currentTimeMillis() changed in anyway in 1.1 ? Feb 14 11:35:20 I was using it to get the time in 1.0, and now it's giving me bizarre values Feb 14 11:48:54 anddd none of my listeners are working for seekbars Feb 14 11:50:36 I think it's sorted now Feb 14 11:50:45 changed to systemclock for elapsedtime Feb 14 11:51:05 and there was a section of the code not throwing an error that prevented listeners being attached Feb 14 13:02:59 don't suppose any devs in here require the services of an icon desseigner? Feb 14 13:03:06 designer even Feb 14 13:03:26 i normally chill in the iPhone dev room, but I thought it might be worth a trawl in here :) Feb 14 13:22:42 show us a portfolio Feb 14 13:22:49 MathCampbell: hehe, I see you there too Feb 14 13:22:58 "trawling" Feb 14 13:22:58 heh Feb 14 13:23:03 sorry :( Feb 14 13:23:07 i'm a whore Feb 14 13:23:07 no worries :) Feb 14 13:23:16 www.mathcampbell.co.uk Feb 14 13:23:19 people need to eat Feb 14 13:23:31 what doe READ_PHONE_STATE actually infer in the phone state? Feb 14 13:23:46 *does Feb 14 13:24:28 launching a new site soon though...all the stuff on there is a little old thanks to all the icons I've done recently are under NDA Feb 14 13:26:20 oh MathCampbell your a fellow scot :) Feb 14 13:26:49 well, i live here. I'm an immigrant from wales though ;) Feb 14 13:27:45 wouldn't have thought Uni of West Scotland was a big design uni though? What about glasgow school of art? Feb 14 13:27:55 (nice icons btw!) Feb 14 13:30:06 ta Feb 14 13:30:15 actually i did a degree in Comp. Animation. Feb 14 13:30:40 i started out as a m3d modeller you see. Do a fair amount of icons in 3D too, but i'm moving more into 2D. Feb 14 13:31:00 If I could do it all over, U probably would have done graphic design in the GSoA Feb 14 13:31:07 I, even Feb 14 13:31:29 but as it was only paisley and Dundee do a comp. ani degree and I didn't want to move Feb 14 13:32:19 fair enough :) I tried the Computing + Games at Abertay and hated dundee, dropped out after 1st year Feb 14 13:32:46 heh, i have friends on that. Feb 14 13:33:10 i'm making a good amount doing icons, and whilst i do like my 3D, icons are fun. 2D or 3D. Feb 14 13:33:17 it was the first year is was available, god 10 years now, so it wasn't that great back then Feb 14 13:33:43 John Sutherland if I'm not much mistaken? Feb 14 13:33:55 he's now at Pisley doing Compp. Ethics. Feb 14 13:34:18 i'm moving much more into doing coding now, my design sucks Feb 14 13:34:22 doing as in he does the course. He's the lecturer behind the course at dundee Feb 14 13:34:33 name rings a bell actually Feb 14 13:34:42 he's a good bloke Feb 14 13:34:58 i think i know a guy called John Sutherland in Edinburgh though, thats why Feb 14 13:35:28 annoyingly enough most of thework i do is still under NDA till the app launches. Which in a lot of cases, as they're iPhone apps can take a while. Damn Apple. Feb 14 13:35:35 Can show this though: http://skitch.com/mathcampbell/brqfg/eos400d-512x512 Feb 14 13:36:21 whooops Feb 14 13:36:43 you going to be working on any android apps? Feb 14 13:36:46 and here's a small icon that i did; it's big here but meant for 48x48 http://skitch.com/mathcampbell/brqgi/camera-lens Feb 14 13:37:10 my coding skills aren't up to much sadly. I'm only really learning the very basics of mac dev. Feb 14 13:37:20 i do icons now for my business. Feb 14 13:37:34 but if someones wanting icons, I'll do them for whatever platform they want.... Feb 14 13:38:16 well, i may do. my app icon sucks :) Feb 14 13:38:32 s'why i'm in here really. I need to expand my sphere of influence. I'm pretty well know in the mag & iphone rooms but I want to get well known everywhere; need to start findng the "right" forums.... Feb 14 13:38:53 heh, e-amil me if you do. My rates are pretty cheap compared to the lies of most outfits. Feb 14 13:39:21 what would it be for a 48x48 icon? Feb 14 13:41:21 toolbar Feb 14 13:41:40 so it's actually 24x24 but you do them so they look good at twice res for res-ind. Feb 14 13:46:33 well pm me your email and i might be in touch to get some icons for my app Feb 14 13:50:59 done **** BEGIN LOGGING AT Sat Feb 14 14:03:53 2009 Feb 14 15:23:52 digitalspaghetti: hey. would you let me know what MathCampbells rates are, if you take him on? Feb 14 15:24:03 i drew my own icon for my current app, but a pro could have made a better one Feb 14 15:24:07 and i don't mind paying for talent Feb 14 15:44:46 exactly :) Feb 14 15:52:31 how do i call another method after a thread has run, http://paste.ifies.org/352 isn't working on the Throwable Feb 14 15:52:59 and i get an error about calling a method at the end of the try in the run about only being able to call from the same thread Feb 14 15:54:01 oh stupid me, i need a handler to pass off a message :| Still getting my head around the threads stuff Feb 14 16:03:13 yeah you can only use manipulate the GUI from the main thread Feb 14 16:06:23 how do i stop a UI refreshing between landscape changes? My home screen fetches data from the web and does it when you open a close, but the first time I create an object to store it Feb 14 16:37:15 digitalspaghetti: you're using a webview? Feb 14 16:37:24 digitalspaghetti: the only way i found was to handle the config changes Feb 14 16:37:34 digitalspaghetti: that way the webview won't try and reload its content Feb 14 16:37:37 imho it's a webview bug Feb 14 16:37:52 eh Feb 14 16:37:53 android:configChanges="keyboardHidden|orientation" Feb 14 16:38:00 put that on your activity tag in the manifest Feb 14 16:47:38 is there a way to find if my activity is paused, other than tracking it in onPause/onResume? like an isPaused method? i don't see one on Activity Feb 14 17:07:22 no, it's a gridview Feb 14 17:07:33 but it makes a get request to get data Feb 14 17:09:29 ahh :| Because the UI doesn't refresh my logo doesn't load the one for that layout Feb 14 17:27:00 digitalspaghetti: right :) Feb 14 17:27:07 digitalspaghetti: that's why it's kind of a hack .... Feb 14 17:27:20 digitalspaghetti: you can use the optimization trick to solve it Feb 14 17:27:36 digitalspaghetti: onRetainNonConfigurationInstance() Feb 14 17:28:26 digitalspaghetti: change your code to create the WebView not from XML but from Java. Then use onRetain...... to pass the old webview to the onCreate of the new activity, and re-use it if it's there Feb 14 17:28:31 i think that should give you the best of both worlds Feb 14 17:46:32 TD: imho it's a webview bug << no, that's how the activity model works Feb 14 17:46:44 TD: digitalspaghetti: change your code to create the WebView not from XML but from Java. Then use onRetain...... to pass the old webview to the onCreate of the new activity, and re-use it if it's there << do NOT do this Feb 14 17:46:51 this will leak the ENTIRE previous activity Feb 14 17:47:01 you have to disconnect it first? Feb 14 17:47:08 you can't Feb 14 17:47:14 a View is tied to a Context at build time Feb 14 17:47:36 how are we meant to solve this then? the webview will reload the content whenever orientation changes, which is amazingly ugly. Feb 14 17:48:13 side effect of the object being torn down on screen rotation Feb 14 17:48:17 by "webview bug" i meant that this behavior is (as far as I can tell) never what you actually want, but webview does the wrong thing by default Feb 14 17:48:25 it does not Feb 14 17:48:26 romainguy__: any tips on market debugging? suppoed to be showing this thing off @ katsucon in a couple hours (informal thing but about 50-60 people) and dls are hanging at "starting download" Feb 14 17:48:28 well yes. i know what causes it :) the question is, how to solve it Feb 14 17:48:29 you get a *different* WebView Feb 14 17:48:35 handle orientation change yourself Feb 14 17:48:51 or file a feature request to be able to pass around the internal state of webview to the new webview Feb 14 17:48:56 and if there are some resources that differ between landscape and portrait? Feb 14 17:49:10 then you will have to accept that the webview has to reload Feb 14 17:49:39 but don't leak the activity to "solve" that Feb 14 17:49:44 (and the complain that you run out of memory :) Feb 14 17:50:02 I'm dealing with something similar with a long operation with ProgressDialog launched from onCreate. I kick off my loading... (over the web) and if teh orientation changes, I have to shut down that web request and start it up again, wasting whatever time has already been spent loading data. Feb 14 17:50:02 yeah ok. i forgot that widgets pin the entire activity into memory. it feels like the ownership would be one way. Feb 14 17:50:26 Just take the teardown-buildup on screen rotation as a small payment in order to know that you're always up to date on configuration changes. Feb 14 17:50:51 rsteckler: you could legitimately use the onRetain mechanism to fix that though, as it wouldn't create a memory leak Feb 14 17:52:52 TD. Possible, but the http code isn't in the activity - it's encapsulated in another class. When the activity is destroyed, I could reach into that class, across threads and ask for retention data, then try to restore it onCreate (again across threads) Feb 14 17:52:55 romainguy__: do view heirarchies get a chance to see the old heirarchy during activity reconstruction? i am guessing the answer is "no". if so then maybe webview could be extended without needing a new api Feb 14 17:52:57 romainguy__: i wasn't going to anyway, it's not a webview Feb 14 17:53:23 it'd be nice if the framework handled this by itself, rather than needing developers to know they had to pass webview internals across configuration reloads Feb 14 17:54:50 rsteckler: not sure i understand you. you don't need to ask for retention data. just keep the class encapsulating the request in memory, pass it through to the newly instantiated activity. there is no race because the old activity is in the process of shutting down, so as long as you don't use that pointer after onRetain there is no possibility of old and new activities colliding Feb 14 17:59:08 TD. (in a thread in the initial activity) {myHttp.doLongOperation(); string result = myHttp.results();} So if I save off myHttp while it's in the middle of doLongOperation, and then restore it to the new activity, doLongOperation continues to run the the background thread of the original activity? Feb 14 17:59:25 When it returns, where does it return to? How would the new activity know when doLongOperation was finished? Feb 14 17:59:40 (I obviously can't hold on to a reference to the activity for a callback =__ Feb 14 17:59:47 * =)) Feb 14 17:59:58 nada Feb 14 18:00:02 oops wrong channel sorry :) Feb 14 18:00:48 rsteckler: well the activity is just an object. any threads you create from one will run until they finish or the process is torn down. Feb 14 18:00:56 rsteckler: yes you'd need to repoint the "i am finished" callback Feb 14 18:01:20 rsteckler: i think if you are always creating a new thread each time, you will find several of them running if you flip the lid open/closed a few times Feb 14 18:03:17 Which means now I need a callback version(which I didn't need in the first place), and onRetain needs to know to repoint this new callback to itself. Or I could just spin up a new thread, let the old one die off in never-never land, and hope some OCD person doesn't try to see how quickly they can flip the keyboard in and out. If the threads only last for 5 seconds, there should at most be 2 or 3 lying around... Feb 14 18:03:54 so yea - Possible, but man, that's a lot of work just to handle an orientation switch =) Feb 14 18:07:05 you're not the only one thinking that :-) Feb 14 18:07:35 Oh, but I actually came here with a question. Is it safe to save off a dialog created in onCreateDialog as a member variable, as long as I don't use it after onDestroy? Feb 14 18:07:52 my current problem is that my activity needs to get a string and a byte array from a service. they are linked and need to update atomically. the service runs a thread, which locks itself then updates them both together - so far so good. but now how do I pass this across the RPC boundary? Feb 14 18:09:20 I would guess that the built in SQL store supports atomic inserts/gets Feb 14 18:09:56 yeah but i don't want to save to storage for this. it's just temporary until the service sends a new string/array pair to the iu Feb 14 18:09:57 gui Feb 14 18:10:15 i think i need a wrapper class, which implements Parcelable. then i can pass this as an "out" parameter from a getLastFoo() method on the service Feb 14 18:10:44 or just return the wrapper i guess Feb 14 18:10:47 Or serialize the wrapper to a byte array Feb 14 18:11:19 but yea, I think the Parceable is probably the right way to do it Feb 14 18:51:42 hey! just a quick question: is there a way to display android's default load-image (orange circle thingy) in my own activity? Feb 14 19:07:23 metachris: ProgressDialog with indeterminate set to true Feb 14 19:07:52 I think you can also put it in the title bar... Feb 14 19:10:32 Doesn't seem to be a way to fake the emu into thinking there is a voicemail waiting... Feb 14 19:28:44 thx rsteckler Feb 14 22:29:05 does anyone have a pre-compiled zxing ? Feb 14 22:29:11 i'm having problems compiling it Feb 14 22:56:58 romainguy__: ping Feb 14 23:47:36 I have a ListView where the _selected_ TextView items are not readable because the orange selection seems to cover the text. How did I cause this? in the ApiDemo it's different. Feb 14 23:48:12 its only one selected item Feb 14 23:49:05 you probably asked listview to draw the selector on top Feb 14 23:49:09 there's an attribute for that Feb 14 23:50:03 romainguy__: oh. seems so :-) Feb 14 23:50:13 romainguy__: thanks Feb 14 23:50:45 .oO( where the heck did I copy that from? ) Feb 14 23:50:46 Any specialist of layouts? Feb 14 23:51:21 yes Feb 14 23:51:38 * MikHel wants to have two buttons (OK and cancel) that have the same size inside a LinearLayout and that are centered... Feb 14 23:52:44 give the linearlayout a weightSum of say, 4.0 Feb 14 23:52:49 each button a weight of 1.0 Feb 14 23:52:59 and use a center_horizontal gravity on the linearlayout Feb 14 23:54:19 romainguy__: OK let me try. weightSum is an attribute? Feb 14 23:56:12 they're all attributes Feb 14 23:59:19 layout_weightSum ??? I thought the sum always had to be 1.0 Feb 14 23:59:26 no Feb 14 23:59:41 and the sum is automatically computed when you don't specify the weight sum Feb 14 23:59:51 using two weights of 33 is like using two weights of 0.5 Feb 15 00:01:47 romainguy__: any chance of adding the com.google* api stuff to the new dev site? Feb 15 00:02:02 like com.google.zxing Feb 15 00:02:26 these are not necessarily public APIs Feb 15 00:02:33 and zxing is not even part of the platform Feb 15 00:02:50 but it's included in android.jar ? Feb 15 00:03:10 romainguy__: Once I supply weightSum, suddenly the buttons are squeezed to the left.... Feb 15 00:03:17 if it's not in the javadoc, it's not a public API Feb 15 00:03:26 MikHel: did you give them a weight? Feb 15 00:04:11 Yeah Feb 15 00:04:29 did you set the gravity on the linearlayout? Feb 15 00:05:20 http://pastebin.com/m6c2347ea Feb 15 00:05:38 Have a look and tell me if I missed something. Feb 15 00:06:41 you did not set the gravity Feb 15 00:06:45 you set the layout_gravity Feb 15 00:07:23 Ooops. Thanks :) Feb 15 00:08:01 romainguy__: How could I have a space between the button and that everything is equaly spaced? Feb 15 00:08:19 Add empty text boxes? Feb 15 00:08:39 no Feb 15 00:08:41 use margins Feb 15 00:09:01 How? Feb 15 00:09:27 read the documentation Feb 15 00:09:33 or look at samples Feb 15 00:55:09 romainguy__: Is relativelayout seriously broken? I am taking examples and they do not work. Feb 15 00:55:18 no it works just fine Feb 15 00:56:15 Grrrr Feb 15 01:00:40 droiddraw really is not up to date :( Feb 15 01:00:50 it's not Feb 15 01:00:58 there's a UI builder in the eclipse plugin btw Feb 15 01:01:21 Builder? Or you mean it shows what you have typed will do? Feb 15 01:01:26 both Feb 15 01:01:42 it even uses Android's code to do the rendering Feb 15 01:01:47 Oh. I did not know it can build. How? Feb 15 01:01:53 just add widgets Feb 15 01:02:57 Is there a tutorial how to test user-interfaces in android? I saw the monkey, and I remember seeing a Test that simulated input. but I can't find it anymore. Feb 15 01:03:28 and I can't find a section in the new dev guide Feb 15 01:03:31 romainguy__: How do I add them? From ehre? Feb 15 01:03:36 where Feb 15 01:04:26 Oh I think I see where.. Feb 15 01:09:08 was the UI builder in eclipse upgraded? **** ENDING LOGGING AT Sun Feb 15 02:59:58 2009