**** BEGIN LOGGING AT Fri Feb 06 02:59:58 2009 Feb 06 03:14:13 man i can't get the loading dialog to work right Feb 06 03:14:19 it always appears after the fact Feb 06 03:16:30 progressdialog? Feb 06 03:16:46 yeah .. Feb 06 03:16:56 ive tried threading and everything Feb 06 03:17:02 and i can't get it to work right Feb 06 03:17:04 You need to start the progress dialog, then do your work inside of it. Feb 06 03:17:07 one sec. Feb 06 03:17:16 oh? Feb 06 03:17:21 inside you say Feb 06 03:17:45 so yea - start the progress dialog, then startup a thread to do the work. Feb 06 03:17:53 when the work is done, notify the progress dialog, and it will go away Feb 06 03:18:52 well the problem is i start it up and then thread off some work and the work still halts the program Feb 06 03:19:09 so the progress dialog is up for a fraction of a section after the work is done Feb 06 03:19:22 can you paste the source? Feb 06 03:19:31 (at pastebin - not here) Feb 06 03:20:20 ehh well i have to put code back in Feb 06 03:20:23 give me a few Feb 06 03:20:58 I have it working in my project, so I knw it's possible =) Feb 06 03:24:01 hmmm Feb 06 03:24:52 ill use the setProgressBarIndeterminateVisibility(false); Feb 06 03:24:58 for simplicity sake Feb 06 03:25:35 oh wait Feb 06 03:25:41 what the .. is it working now? Feb 06 03:28:00 see? I'm good! Feb 06 03:29:47 :P Feb 06 03:35:14 hmm it appears but doesnt look like it's spinning Feb 06 03:35:23 ill try it on the phone Feb 06 03:36:30 myProgress = ProgressDialog.show(this, "Loading...", "Retrieving your Buzzes", true); Feb 06 03:36:30 Thread thread1 = new Thread(this); Feb 06 03:36:30 thread1.start(); Feb 06 03:36:38 ^ Should look like that. Feb 06 03:37:02 and thread1 does all the background work. Feb 06 03:38:07 setProgressBarIndeterminateVisibility(true); Feb 06 03:38:08 new LoadThread().start(); Feb 06 03:38:25 then a setProgressBarIndeterminateVisibility(false); at the end of the thread Feb 06 03:38:32 no Feb 06 03:38:40 don't change Views from a background thread Feb 06 03:41:45 bah Feb 06 03:42:07 so when do i change it back? Feb 06 03:42:59 is there like a thread complete listener? Feb 06 03:45:27 You send it messages from the background thread over a listener. Feb 06 03:45:36 one sec - I'll post some working code Feb 06 03:47:31 silly OO code .. I'll never get used to it Feb 06 03:47:57 it has nothing to do with OO Feb 06 03:48:39 threads, classes, etc Feb 06 03:48:48 threads have nothing to do with OO Feb 06 03:48:56 http://rafb.net/p/pOIIrK68.html Feb 06 03:48:58 See if that helps Feb 06 03:49:12 no but you tend to have threading support in OO Feb 06 03:49:15 languages Feb 06 03:50:12 Android (and most gui systems) only have 1 ui thread running. If you block it, the ui stops responding. But you can't update the UI from a non-ui thread. The solution is a messaging system that lets the background thread tell the ui thread what to do. But the UI thread has to be the one to do it. Feb 06 03:50:35 makes sense Feb 06 03:50:47 it would take me a couple years to get my mind trained for this stuff again Feb 06 03:51:22 (that code is pared down from a much larger class - sorry if it doesnt compile. Should get you started, though Feb 06 03:51:23 ) Feb 06 03:53:10 Has anyone figured out how to make the items in a listview not fill the parent? Feb 06 03:53:37 It's seriously pissing me off. The scrollbar is overwriting the items. I can layout_marginRight the listView, but not the items inside. Feb 06 03:54:43 and I've tried *everything*. Padding on the row (from the adapter's getrow), padding on the control in the row, padding on the root control of the row's control, margins everywhere, from the xml, from the code. Feb 06 03:56:11 I've even set the width of the row item in the list_item.xml to a hard number and it *still* fills the listview row Feb 06 03:56:26 It's like listView stretches each row to its width, no matter what I tell it. Feb 06 03:56:26 so .. if i need to call this thread multiple times during the program running Feb 06 03:56:28 not just startup Feb 06 03:56:53 DJTachyon: Then you repeat the 3 lines (progress.show, thread1... thread1.start) Feb 06 03:57:21 rsteckler: it will stretch indeed Feb 06 03:58:24 romainguy_: Any way to stop it? I want a margin on the left and right of each of my rows. Feb 06 03:58:35 just give them padding Feb 06 03:58:59 That doesn't change the width allocated to them inside their container, though Feb 06 03:59:22 I guess I could account for it in the onDraw of each row's control, but that seems a bit of a hack. Feb 06 03:59:48 onDraw() should always account for the padding Feb 06 03:59:59 And even then, the click highlighting would go clear to the right edge of the screen. Feb 06 04:00:02 all the standard views take it into account Feb 06 04:00:18 then just give padding to the ListView itself... Feb 06 04:00:41 But then the scrollbar on the listview floats into the screen (doesn't stay on the right edge) Feb 06 04:00:49 which looks odd, to say the least. Feb 06 04:00:55 nope Feb 06 04:01:02 you can change the scrollbar style to outside Feb 06 04:01:06 so that it lives in the list's padding Feb 06 04:01:16 AHA! That's what I want. Feb 06 04:01:23 you can also change the padding of the list selector Feb 06 04:01:29 or wrap your item into another view Feb 06 04:01:32 etc etc Feb 06 04:01:50 and you should seriously not try to do this since all list in Android fill the screen Feb 06 04:02:03 it's perfectly expected to have the highlight as wide as the screen Feb 06 04:03:14 Point taken. The visual effect I'm after warrants it, though. Feb 06 04:04:03 that's what they all say :) Feb 06 04:04:36 1 sec - I'll post a screenshot - then you can give me your brutally honest opinion Feb 06 04:07:06 man im just not wrapping my head around this Feb 06 04:08:17 http://www.mybuzzdroid.com/fancyList.png Feb 06 04:08:27 (I need more spacing between listView items, still Feb 06 04:08:34 rsteckler: ok I see what you're trying to do Feb 06 04:08:40 but the borders make the fill_parent width look weird. Feb 06 04:08:41 what you should do is different then Feb 06 04:08:50 put padding in your items Feb 06 04:08:57 and hide the list selector Feb 06 04:09:05 instead, use a state drawable on your items Feb 06 04:09:15 and on state selected given them a highlighted appearance Feb 06 04:09:44 list selector is the full width highlight effect onclick? Feb 06 04:09:51 yep Feb 06 04:10:26 and override onstateselected (or similar) in the item class to change what happens in the ondraw? Feb 06 04:10:26 also, instead of doing your own drawing you should use a nine patch for the background of your items Feb 06 04:10:30 no no Feb 06 04:10:33 no need to code Feb 06 04:10:38 all you need is an XML file Feb 06 04:10:45 ok. Because right now it's all custom draw Feb 06 04:10:52 it shouldn't :) Feb 06 04:11:02 damn. =) It looks good though Feb 06 04:11:38 rsteckler: here is an example: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/drawable/btn_default.xml;h=b8ce2bfe9117f30e8ab6fa4a9c50c7ebd00f1d5d;hb=master Feb 06 04:11:58 I haven't used nine patch, but I've heard of it. I'll go read up on it. The reason I didn't use a background drawable is because the height of each item is dyamic, and I wasn't confident the stretching would look good. Feb 06 04:12:10 that's what 9patches are for rsteckler Feb 06 04:12:13 I'll take a look at that. Much thanks for the guidance. Feb 06 04:12:14 we use them throughout the system Feb 06 04:12:24 the highlight in listview is a 9patch btw :) Feb 06 04:13:03 9patch ftw Feb 06 04:13:07 they look so good :) Feb 06 04:13:24 technically we use n-patches, not 9-patches Feb 06 04:13:27 but we still call them that Feb 06 04:13:38 :) Feb 06 04:13:44 hey rsteckler, check your pm Feb 06 04:14:17 a simple tiny little 9patch white border makes an app look great Feb 06 04:46:11 is it possible to get a reference to the "option menu" Menu object from an Activity? Feb 06 04:48:03 outside of onCreateOptionsMenu :) Feb 06 04:48:54 From inside the activity? Feb 06 04:49:16 Yes, like in the onStop() method. Feb 06 04:49:47 I could save a reference to it when in the onCreateOptionsMenu option, but is there a better way? Feb 06 04:52:05 You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called Feb 06 04:52:12 ^ from the javadoc... Feb 06 04:52:42 Ugh, that feels dirty. :( Feb 06 04:53:35 I agree. Feb 06 04:54:28 To make myself feel better, I would add an accessor to my class that returns the saved field. That way I could call this.getMenu() and pretend it was part of the frameowrk Feb 06 04:54:53 That's how I get through life. Lying to myself =) Feb 06 04:55:27 So nine patch is cool. The only problem with using nine patch instead of onDraw is that I'm a better coder than an artist. Feb 06 04:56:03 I'll make an abstract subclass of Activity and add getMenu() and onCreateOptionsMenu() :D Feb 06 05:06:04 My god. The amount of crap you can do in XML here rivals WPF/Xaml Feb 06 05:13:31 yup Feb 06 05:14:26 rsteckler: you can generate your 9patch with code :) Feb 06 05:14:35 rsteckler: also 9patches are more versatile Feb 06 05:14:53 because you can load different ones depending on the screen orientation, language, screen size, etc. Feb 06 05:14:59 (and it's automatic) Feb 06 05:15:29 I'm bought in, because I just created my selected state by copying and modifying my normal state png Feb 06 05:16:44 I'm still a little unclear on how to reference the new xml drawable selector I created, though. I see android:listSelector, but that's only for the highlight. Feb 06 05:16:53 (and I have all states in my xml selector) Feb 06 05:17:00 then use android:background Feb 06 05:17:17 you can also, from code, do something like getResources().getDrawable(R.drawable.blah) Feb 06 05:23:09 cool. It worked. Kindof. Ugly as sin - I think photoshop dithered the border pixels...but I can definitely get it from here. Feb 06 05:23:15 Thanks for your help, romainguy_ Feb 06 05:24:50 np :) Feb 06 05:24:59 rsteckler: photoshop will not dither it for you Feb 06 05:25:07 but you should dither gradients in photoshop Feb 06 05:25:21 remember that Android draws everything in the end in 16 bits (565) Feb 06 05:25:53 I'm loading it up in draw9patch now - rather than trying to get the border pixels correct in PS Feb 06 05:26:03 that's why I wrote that tool :p Feb 06 05:26:53 If you're in MTV, you should get off the computer and get some rest =) Feb 06 05:27:03 9:30? Feb 06 05:28:45 oooooooo. Real time preview of different sizes =) Feb 06 05:46:14 Hm. Think I found a bug in the XML engine (Schema?). I accidentally typed android_paddingLeft="20px" and it didn't flag it as an error in the XML. Ignored it at runtime, though. Feb 06 05:46:21 (underscore instead of colon) Feb 06 05:48:52 rsteckler: why would it flag it as an error? Feb 06 05:49:08 you can create your own attributes Feb 06 05:49:08 because it's non-existand Feb 06 05:49:19 yeah but the parser doesn't know that Feb 06 05:49:21 Yea, but doesn't it validate user-created attributes? Feb 06 05:49:26 no Feb 06 05:49:28 ah Feb 06 05:49:30 there's no validation Feb 06 05:49:31 nvm, thne Feb 06 05:49:40 it would be too costly for very little gain Feb 06 05:51:08 http://www.mybuzzdroid.com/fancyList.png Feb 06 05:51:09 Thanks. Feb 06 05:51:23 Obviously needs some tweaking, but it defintely accomplished getting it off the right edge. Feb 06 05:51:49 And I can modify my graphic assets in PS rather than in code, which is a win Feb 06 05:51:57 exactly :) Feb 06 06:06:10 romainguy_: If you're still around, it appears that my .9. is being constrained to its original aspect ratio. I'm looking around for a way to allow it to stretch on both axis independently, but I haven't found anything yet... Feb 06 06:06:21 I'll keep looking, but if you know off the top of your head... Feb 06 06:10:05 you can Feb 06 06:10:15 you just need to put stretch marks on both sides Feb 06 06:10:22 9patches don't care about the aspect ratio Feb 06 06:11:09 Hm. Maybe it's my custom control that's doing it then. Feb 06 06:11:21 did you set your 9patch to stretch both vertically and horizontally? Feb 06 06:11:40 Yes. Feb 06 06:11:41 speaking of which, you should look at the hierarchyviewer tool to debug your UI Feb 06 06:12:16 I'll run that and see what I get. Feb 06 06:12:19 http://www.mybuzzdroid.com/fancyList.png Feb 06 06:12:25 That shows the aspect ratio fixed. Feb 06 06:12:44 Not sure why it's that way, though... Feb 06 06:14:33 Man you guys have good tools. Feb 06 06:14:54 we need better tools Feb 06 06:15:00 they're still a bit rough Feb 06 06:15:03 but they mostly get the job done Feb 06 06:15:24 btw, when you have a custom view like yours, you can add more information in hierarchyviewer Feb 06 06:15:43 you just have to put @ViewDebug.ExportedProperty on whatever field or getter method you want to see exposed in the tool Feb 06 06:15:56 Nice. Feb 06 06:16:18 Have you ever developed for Windows mobile or iPhone? Feb 06 06:16:24 nope Feb 06 06:16:33 Don't bother. Feb 06 06:16:51 my previous experiences with mobile devices were with Palm OS 3 and 4 and Java ME Feb 06 06:16:55 I wasn't impressed ^^ Feb 06 06:17:10 I've been writing WM/iPhone code for years and years. Android nailed it from a dev standpoint. Feb 06 06:17:20 glad to hear that Feb 06 06:17:28 I heard iPhone dev was pretty good too Feb 06 06:17:38 i disagree, respectfully. Feb 06 06:17:43 :) Feb 06 06:18:05 The language is odd, but managable. The tools are gross. But the policies at the store make it a deal breaker. Feb 06 06:18:25 Objective-C has some really cool stuff Feb 06 06:18:39 but the syntax is a bit outdated for some things (like the @!# []) Feb 06 06:18:51 I'm trying to get my team onboard with android, but there is still considerable buzz around iphone - mostly from the design team. Feb 06 06:18:53 too bad that they didn't include the GC on the iPhone to Feb 06 06:18:58 +o Feb 06 06:19:05 and Xcode is... argh Feb 06 06:19:13 compared to Java IDEs it's really really basic Feb 06 06:19:23 <_avatar> i personally found uikit much more cumbersome to work with than android Feb 06 06:19:26 <_avatar> and ugh, xcode. Feb 06 06:19:40 and interface builder. Feb 06 06:19:43 Feb 06 06:19:50 the Interface Builder is nice... until you start adding code to your app Feb 06 06:19:59 but it has some really cool features Feb 06 06:20:05 certainly better than our UI builder ^^ Feb 06 06:20:23 Yea - your ui builder sucks. But it's backed by xml, which is a win Feb 06 06:20:39 well our UI builder has one big advantage Feb 06 06:20:47 it runs the actual Android code to render the UI :)) Feb 06 06:20:57 you should see what our SDK guys had to do to make that happen Feb 06 06:21:08 but all the layout and drawing runs the actual code from the views Feb 06 06:21:16 the final rendering is emulated with Java 2D Feb 06 06:21:16 and it's obviously an early model. IB/XCode is Apple's premier dev environment for iphone AND desktop. Feb 06 06:22:08 nice. WPF/C#/Blend/Visual studio do the same. The XAML you create is rendered with the same engine at design and runtime. Even so far as to instantiate objects from the code behind during design time. Feb 06 06:22:22 hehe Feb 06 06:22:28 NetBeans/Swing do the same Feb 06 06:22:43 and then there's apple, off in lala land. Feb 06 06:22:44 the hard part about doing it for Android is that our drawing API is almost entirely based on native code Feb 06 06:22:49 lol Feb 06 06:23:44 strange. So you guys compile the xml down to machine instructions or something? Or just a binary format that's rendered by native code at runtime. Feb 06 06:23:52 it's binary XML Feb 06 06:24:01 Ah. Which would make it challenging for the toolset guys to render it the same at design time... Feb 06 06:24:02 it gets "inflated" at runtime into Views and/or drawables Feb 06 06:24:38 that said I'd rather have our XML be compiled to bytecode Feb 06 06:24:46 it's quite costly to inflate Views Feb 06 06:24:57 (that's why it's always a good idea to use as few Views as possible) Feb 06 06:25:53 Hm. I use view inflations in my listviews. Feb 06 06:26:00 which is normal Feb 06 06:26:09 but the fewer views you use, the faster your app Feb 06 06:26:13 Right. Feb 06 06:26:18 that's where hierarchyviewer comes into play Feb 06 06:26:23 it helps identify what Views you can get rid of Feb 06 06:26:40 (fun tip: double-click a node in hierarchyviewer) Feb 06 06:26:45 and why my layouts end up the way they do... Feb 06 06:26:50 exactly Feb 06 06:26:53 hah. holy crap Feb 06 06:27:10 if you check the "extras" box you get a wireframe of the padding, baseline, etc. Feb 06 06:27:14 That's crazy. Feb 06 06:27:53 and if you select a node and click the invalidate/request layout buttons at the top, it will actually invoke invalidate() and requestLayout() on your views Feb 06 06:28:09 very useful when you hook up a debugger to your app to trigger the drawing code and break into it Feb 06 06:28:18 very cool. Feb 06 06:28:26 and last but not least Feb 06 06:28:32 at the bottom left of the view, there are two buttons Feb 06 06:28:38 click the right one to get a real time view of your app Feb 06 06:28:54 with a zoomed version to check colors and pixels Feb 06 06:29:11 See - there is nothing even close to this on other mobile platforms. Feb 06 06:29:11 and in that view, if you click a node, you get an overlay of the corresponding view's bounds on the real time image of the app Feb 06 06:29:39 Some of these tool concepts aren't even available on desktop dev environments - or they're third party and expen$ive Feb 06 06:29:42 yeah, but the tool is ugly and weird to use :p Feb 06 06:29:55 who cares. It's for developers. Feb 06 06:30:38 how long have you been on the android team? Feb 06 06:32:15 rsteckler: it'll be two years in April Feb 06 06:32:30 first project at google? Feb 06 06:32:37 yep :) Feb 06 06:33:07 very cool. Every year when the fortune "best companies to work for" comes out, I'm tempted. Feb 06 06:36:38 so it looks like if I have a {control1.width=FillParent { control2.width=WrapContent {control3.width=FillParent }}}, control3 is looking up the chain to control1 for it's width... Feb 06 06:37:54 Which makes sense, hmmm. Feb 06 06:40:32 I want to determine the length of an MP3 file. It looks like I can add it to the MediaStore manually with the MediaScannerConnection, which would then store the length in the database, which I could read, but I don't want these files littering the Music application. Is there a way to do that that doesn't involve me parsing MP3 frame headers for the whole file myself? Feb 06 06:42:44 Or if I did have to put them into the media database, I would want to control the title/artist/etc info instead of using what happens to be written in the ID3 tag. Feb 06 09:27:56 Could someone tell me how I can force a ListView to redraw itself in a specific situation Feb 06 09:28:07 in a ListActivity Feb 06 09:28:16 I have tried getListView.requestLayout() Feb 06 09:28:32 but it doesnt work. It is not redrawn Feb 06 09:36:37 When I look at the getView method I can see that it gets called by request Layout and everything is set fine but the display doesnt update :( Feb 06 10:40:11 anno^da-, listview.invalidate() ? Feb 06 10:40:57 It worked now. I used adapter.notifyDataSetChanged() Feb 06 10:41:15 this updates the list view perfectly now Feb 06 10:41:32 And I thinks this is the correct way of doing it Feb 06 10:42:53 anno^da-, .invalidate() should also redraw the list but it won't update the list contents I guess. If your list contents has changed then yes, call notifyDataSetChanged() on the adapter :) Feb 06 11:00:48 Ok fine. Feb 06 11:00:50 :) Feb 06 11:01:06 Saved in my "android coding checklist :P" Feb 06 13:18:30 there's no way to scroll a TextView horizontally, right? Feb 06 13:21:12 setHorizontallyScrolling(boolean) only telss the TextView it should not wrap the contents by itself and they can be wider than the TextView but it doesn't seem to actually enable horizontal scrolling. Feb 06 13:35:48 there is no horizontal scroll until cupcake. unless you write it yourself. Feb 06 13:42:28 morganx, thanks. that's what I was afraid of :( Feb 06 13:43:25 hmm Feb 06 13:43:50 http://code.google.com/android/reference/android/widget/TextView.html#attr_android:scrollHorizontally Feb 06 13:43:56 that doesn't work? Feb 06 13:47:25 duh. i guess not. Feb 06 13:47:33 if it's the same as setHorizontallyScrolling(boolean) then no. (I'm creating the view in code not xml so I can't try attr_android:scrollHorizontally) Feb 06 13:48:40 it is the same Feb 06 17:28:34 is there a possibility to set a String instead of an icon into the status bar? Feb 06 17:28:41 (for a notification) Feb 06 17:29:10 Or do I really have to create little string images Feb 06 17:29:20 and combine them :P Feb 06 17:36:04 Please don't. There isn't really enough room up there for a string. Feb 06 17:39:21 :D Feb 06 17:39:30 Well it is for my custom use ;) Feb 06 17:39:54 I just want to update a string which I get from a text file on my webserver Feb 06 17:40:09 and I don't want to pull down the status bar all the time Feb 06 17:47:05 anno^da: how many possible events are there? Feb 06 17:53:27 Well it is a number Feb 06 17:53:30 from 1-100 Feb 06 17:53:42 So I dont think it is possible in the status bar Feb 06 17:54:06 (it is in the extended bar - but well it would have been nice to have it directly in the status bar) Feb 06 17:54:30 I will do a pop up or a sound notification now when the number got refreshed Feb 06 17:54:47 seems to be the easiest solution :) Feb 06 17:55:28 anybody want to give me some pointers on this progress dialog thread class? Feb 06 17:59:58 DJTachyon: Whats the progress dialog thread class? Feb 06 18:00:48 im making a thread for doing long work that will show a progress dialog Feb 06 18:00:50 Does someone know if there is an broadcast action sent for "service lost" ? Feb 06 18:01:09 and the interaction between the UI thread and handling completion of my thread is complicated Feb 06 18:01:14 i can't figure it out ... Feb 06 18:01:31 DJTachyon: The way I did it was create the progress dialog, run the thread and have the thread post a runnable that dismisses the progress dialog Feb 06 18:01:48 I think you might find that easier then having a progress dialog in a thread Feb 06 18:02:20 you are supposed to use handlers to pass completion and dismiss commands to the UI Feb 06 18:02:47 yes, a handler posts a runnable that dismisses it I believe Feb 06 18:02:51 sorry I left that out Feb 06 18:03:02 I don't have my code here either, so I could be wrong too :) Feb 06 18:03:09 hmmm Feb 06 18:03:16 well i mean i can kind of get it to do the work Feb 06 18:03:28 but when i try and do any dialog work in it, it throws exceptions Feb 06 18:03:42 What do you mean by dialog work? Feb 06 18:04:01 like creating a progress dialog in the oncreate and dismissing it in the handler Feb 06 18:04:25 hmm, let me see if I can get a copy of my source somehow Feb 06 18:04:34 i need to call this thread often .. so it's not just at startup Feb 06 18:04:47 it is a class that extends activity that implements runnable Feb 06 18:06:03 externally i call it by creating an instance of that class and creating a new thread from that class and then thread.start(); Feb 06 18:06:39 hmmm .. Feb 06 18:07:12 heh, well that sounds way more complicated then what I am doing, are you sure you need that? Does a thread really need to extend activity? Isn't an activity a metaphor for UI? Feb 06 18:07:57 Or did I misunderstand you... Feb 06 18:08:07 well here look Feb 06 18:08:07 http://www.helloandroid.com/node/243 Feb 06 18:08:45 Have you looked at whats changed with that between M5 and 1.0? Feb 06 18:09:13 well i got advice as well from other people on this Feb 06 18:09:19 http://rafb.net/p/pOIIrK68.html Feb 06 18:09:21 rough example Feb 06 18:09:24 doesn't compile Feb 06 18:10:09 i mean it makes sense Feb 06 18:10:41 Ah, I did misunderstand you Feb 06 18:12:37 unfortunately I can't get to my code from work and I don't remember it off the top of my head Feb 06 18:12:48 That rough example doesn't extend activity though? Feb 06 18:12:48 http://pastebin.com/d6180b7f2 ... Feb 06 18:12:50 there Feb 06 18:12:55 well that was a mistake Feb 06 18:12:58 on his part Feb 06 18:13:03 it was a chopped up example Feb 06 18:13:08 ah ok Feb 06 18:13:09 that paste is what im doing Feb 06 18:13:16 and it throws Feb 06 18:13:34 What does it throw? Feb 06 18:14:01 i dont know Feb 06 18:14:09 i have to catch it somehow Feb 06 18:14:43 im not familiar enough with logging exceptions yet Feb 06 18:14:50 i have coded java in 5 years :P Feb 06 18:15:05 well, if its crashing you should be able to find out what the exception was Feb 06 18:15:07 its the pd.dismiss() that is the problem Feb 06 18:15:20 but the progress dialog isn't showing up anyway Feb 06 18:15:36 is my referencing incorrect Feb 06 18:15:47 ProgressDialog.show(**this**, Feb 06 18:16:03 i have a feeling this has to do with views Feb 06 18:16:17 and context Feb 06 18:16:26 yeah, unfortunately its going to be really hard to tell until you get the error/exception Feb 06 18:16:39 Does it actually force close? or just not work? Feb 06 18:16:44 force close Feb 06 18:16:48 And are you using eclipse? Feb 06 18:16:57 yeah Feb 06 18:17:18 When it force closes, just hit F6 until you see the exception in the top right debug window Feb 06 18:17:34 Or rather the top right pane in the debug window Feb 06 18:19:18 The only thing I can remember that I am doing differently is that I use the handler to post a runnable to the UI thread Feb 06 18:19:35 instead of sendmessage(); Feb 06 18:19:41 invocation target exception Feb 06 18:19:57 What else? Feb 06 18:20:05 null pointers Feb 06 18:20:29 hmm... have you tried stepping through it to see if pd isn't null? Feb 06 18:21:38 well since im not getting the progress dialog Feb 06 18:21:49 i have a feeling the context im sending the progress dialog to is incorrect Feb 06 18:22:09 It may be, and that might be why pd is null as well Feb 06 18:22:36 yeah Feb 06 18:22:41 how do i get that context? Feb 06 18:22:48 from super or something? Feb 06 18:22:52 getApplicationContext();? Feb 06 18:24:12 not so much? Feb 06 18:24:15 getBaseContext() is another one Feb 06 18:24:22 I'm not very clear on the contexts though Feb 06 18:24:58 well this is just a class defined in the base class Feb 06 18:25:15 I gotta get back to work but I'm sure I'll be online over the weekend, feel free to bug me if you'd like to see how I am doing it Feb 06 18:25:36 sorry and good luck Feb 06 18:25:50 kay thanks Feb 06 18:38:58 I was just wondering on how to give the user the possibility to modify the UI of my app, with a kind of plugin (during runtime). Feb 06 18:39:17 For Java there is the JPF which would do the job, but on Android :/ ... ? Feb 06 19:03:52 oh hey plusminus how you doin? Feb 06 19:16:47 plusminus__: I've been considering the same thing Feb 06 19:17:22 plusminus__: it doesn't seem like it's very easy to create a Theme object on the fly, especially because all the drawables in the theme seem like they need to point to resources Feb 06 19:17:36 runtime styling is not supported Feb 06 19:18:14 romainguy: there's nothing planned for that right? Feb 06 19:18:36 not atm Feb 06 19:18:57 or if there is something it must be so low on our list of priorities that it's buried deep under our office Feb 06 19:19:35 yeah...I've been thinking about how to make it work, but haven't figured out a very clean way to do it Feb 06 19:19:40 hey romain Feb 06 19:19:47 can you do me a favor? Feb 06 19:20:03 http://pastebin.com/d4c05cdb4 ... slap me when you tell me what stupid thing im doing wrong Feb 06 19:20:33 why do you have an Activity inside an Activity? Feb 06 19:20:59 dunno? :P Feb 06 19:21:09 the example code may have been misleading Feb 06 19:21:13 I'm changing it... Feb 06 19:21:43 i was thinking i had context issues with the progress dialog .show call Feb 06 19:22:33 DJTachyon: this is more like it: http://pastebin.com/m24952de0 Feb 06 19:23:51 ahhhhh Feb 06 19:23:52 :) Feb 06 19:24:02 okay thats kind of what i had before Feb 06 19:24:07 actually, line 15 should be more like loadRSS.start() Feb 06 19:24:09 but people kept telling me to do it this way Feb 06 19:24:12 and get rid of 16 Feb 06 19:24:44 thanks lemme give it a try Feb 06 19:25:05 argh, don't subclass Thread Feb 06 19:25:17 ok DJTachyon you should definitely use UserTask or AsyncTask Feb 06 19:25:31 yeah, I rarely subclass thread Feb 06 19:25:53 DJTachyon: use this class http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/util/UserTask.java Feb 06 19:25:54 oh? Feb 06 19:26:24 heh in all my looking i didnt find anything about usertask or asynctask Feb 06 19:26:38 AsyncTask is the name of UserTask in cupcake Feb 06 19:26:43 ah .. Feb 06 19:27:04 anyway, this class will handle everything for you Feb 06 19:27:06 man im never gonna get this app out :P Feb 06 19:27:36 any example code of this running? want to mod my code example if not? Feb 06 19:28:43 usertask def looks cool Feb 06 19:28:45 yeah, I'd like to see an example of that too Feb 06 19:28:46 the documentation of the class shows an example Feb 06 19:29:01 ah Feb 06 19:29:01 ohh its all in html Feb 06 19:29:02 but there are several examples in http://code.google.com/p/shelves Feb 06 19:29:23 also in http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Photostream/src/com/google/android/photostream Feb 06 19:29:36 yeah, that's a pretty handle class... Feb 06 19:29:40 handy Feb 06 19:29:44 yup Feb 06 19:29:44 for instance the FindUserTask class in http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/LoginActivity.java Feb 06 19:30:09 interesting Feb 06 19:30:22 i knew we kept you around for a reason romainguy :P Feb 06 19:31:16 I've never seen the method(Type... arg) before... Feb 06 19:31:28 shows my java newbness Feb 06 19:31:29 varargs were added to Java 1.5 Feb 06 19:31:42 they're not widely used because relatively new Feb 06 19:32:54 http://www.djtachyon.com/android/usertask.html Feb 06 19:33:02 if anybody wants readable text Feb 06 19:33:03 :P Feb 06 19:35:00 im too busy coding to blog about any of this Feb 06 19:35:39 you know your IDE will show you the formatted comments in a tooltip if you ask nicely :) Feb 06 19:35:48 :P Feb 06 19:35:52 hehe Feb 06 19:36:11 is there a way to have multiple types passed into a vararg method like doInBackground()? Feb 06 19:36:26 zhobbs: if you use the Object type, yes Feb 06 19:36:34 gotcha Feb 06 19:38:04 any news on when marketplace will open up for paid applications? Feb 06 19:38:38 in 37 seconds ;) Feb 06 19:38:44 hehe Feb 06 19:38:51 Frostshock, wrong channel :) Feb 06 19:39:02 sad that runtime-layouts are not yet supported :( Feb 06 19:40:03 where do i include usertask from? Feb 06 19:40:36 DJTachyon: just paste that class into your project Feb 06 19:40:49 plusminus_: runtime layouts are supported, just not styles Feb 06 19:41:00 DJTachyon: and change the package name at the top Feb 06 19:41:35 download the whole file you mean? Feb 06 19:42:42 its copyright google though! :P Feb 06 19:42:58 it's licensed under the Apache 2.0 license Feb 06 19:43:19 i figured Feb 06 19:43:25 I accidentally the whole file. Feb 06 19:43:27 and its copyright The Android Open Source Project and myself Feb 06 19:43:55 is asynctask any different? Feb 06 19:44:08 AysncTask is the same API, same implementation, different name Feb 06 19:44:18 and it's part of the Android platform Feb 06 19:44:46 but not til cupcake Feb 06 19:44:57 indeed Feb 06 20:12:13 well i just changed 200 lines of code at once Feb 06 20:12:18 lets see if it works romainguy :P Feb 06 20:12:46 well it didnt throw an exception Feb 06 20:12:51 but its not returning from the task :P Feb 06 20:13:38 onPostExecute isn't getting called Feb 06 20:13:53 check out the logcat Feb 06 20:14:03 there might be an exception in there Feb 06 20:15:19 oh its the do in background thing Feb 06 20:15:27 its expecting me to pass something to it Feb 06 20:15:49 can it not be void? Feb 06 20:16:00 did you specify the type to be Void Feb 06 20:16:02 ? Feb 06 20:16:26 yeah hmm Feb 06 20:16:46 public Void doInBackground(Void... params) Feb 06 20:16:59 everything is void Feb 06 20:17:27 oh on post execute .. Feb 06 20:17:53 does that need a void or can it be public void onPostExecute() Feb 06 20:18:11 Void Feb 06 20:18:17 it's the same type returned by doInBackground Feb 06 20:19:52 hmmm Feb 06 20:30:54 Anybody know what the plan is for Packages/Applications/Launcher? There's lots of talk of a pluggable widget API but all I see is a switch statement.. or is this more a h/w channel Feb 06 20:31:20 Sorry cut & paste from #android, but can't seem to get any sense out of them... Feb 06 20:32:50 romainguy, it is the onPostExecute im pretty sure ... Feb 06 20:33:43 it doesn't like any way i declare it when i @Override it Feb 06 20:35:16 if all parameters are void, how do i declare void result? Feb 06 20:36:12 andyclap: there's supposedly going to be widget support for the Home screen eventually Feb 06 20:38:07 haven't heard anything about it in a while though... Feb 06 20:42:06 WOO HOO!! Feb 06 20:42:08 that worked :) Feb 06 20:42:08 hah Feb 06 20:42:15 nice one romain guy Feb 06 20:42:16 :0 Feb 06 21:07:22 hi - does anyone know how to use httpclient 4.x? the javadocs are maddeningly useless Feb 06 21:07:36 i'm trying to set the connection timeouts, but can't figure out where to get an httpconnectionparams from Feb 06 21:15:01 oh, i see Feb 06 21:15:11 it's some bizarre property setting scheme ... Feb 06 21:48:12 mmmm, music for hacking on Android Feb 06 21:48:19 * ctate cues up Ladytron, "Destroy Everything You Touch" Feb 06 21:48:44 ctate++ Feb 06 21:52:17 hey romainguy i got one for you Feb 06 21:52:51 one what? Feb 06 21:57:11 hey romainguy i got one piece of chocolate for you Feb 06 21:57:19 that I can do :)) Feb 06 21:57:26 :) Feb 06 21:58:09 gotta know your audience Feb 06 22:10:25 okay guys Feb 06 22:10:32 go vote on my app! Feb 06 22:10:34 ZazzleDroid Feb 06 22:10:38 before all the wierdos do Feb 06 22:13:15 You mean, we have to vote it down so that the weirdos don't see it? Feb 06 22:13:59 ugh Feb 06 22:14:03 bugger off Feb 06 22:14:09 :P Feb 06 22:14:15 i worked hard on that Feb 06 22:14:19 DJTachyon: what's it do? Feb 06 22:15:01 you can browse the zazzle website Feb 06 22:15:11 but through the android api Feb 06 22:17:53 damn garbage Feb 06 22:17:59 people must just sit there waiting to comment first Feb 06 22:38:49 DJTachyon, lots of irrelevant comments - http://www.cyrket.com/package/com.djtachyon.android.zazzledroid Feb 06 22:41:47 mark as spam Feb 06 23:34:05 hi guys, just wondering if anyone knows if the android plugin supports a similar feature to netbeans' 'flows' Feb 07 01:19:15 What's the best way to make sure that my SDK is up to date in Eclipse? How can I update it? Feb 07 01:21:04 i might be wrong, but the emulator etc. would need to be re-downloaded manually if theres an update Feb 07 01:21:16 the eclipse plugin could be updated via eclipse though **** ENDING LOGGING AT Sat Feb 07 02:59:58 2009