[android-developers] Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
I have extended an SimpleCursorAdapter and define a FilterQueryProvider like so: setFilterQueryProvider(new FilterQueryProvider() { public Cursor runQuery(CharSequence constraint) { return getMatching(constraint); } }); I can't see how the Cursor can be managed because this class

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
I've reported this as an SDK bug because I don't think the code in CursorAdaptor is doing what the JDK is saying, well atleast in 1.6 it isn't anyway. http://code.google.com/p/android/issues/detail?id=24322 -- You received this message because you are subscribed to the Google Groups Android

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Yes I've also looked at the 2.3.3 code and the same problem is there. As a work around in my Adapter I record the Activity that created it, then in the runQueryOnBackground I make a call on the activity to manage the cursor. It's not a nice way of doing it but sorts the problem out as far as I

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Thanks for the reply skink. I've tried what you suggested and yes changeCursor is getting called, now I look at the code again I can see how. I can also now see what the cause of the memory leak it. Basically when the activity is destroyed that contains views with CursorAdapters there appear to be

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
I added the following to my adapter and that seems to have fixed the problem: @Override public void changeCursor(Cursor newCursor) { Cursor oldCursor = getCursor(); super.changeCursor(newCursor); if(oldCursor != null oldCursor != newCursor) { // adapter has already dealt

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
what about this: http://stackoverflow.com/questions/6542745/whats-the-purpose-of-start... Interesting, thanks for the link. Not sure if I should introduce the v4 support into my app or not. I'm not far off releasing so maybe I'll get the first version out and then look at things like this

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Kostya I think your right, even though the managedCursor mechanism basically does what I want I don't like it. I think the mechanism you mention in the destroy method is the way to go with this however I really think the platform should be looking after all of this correctly. As you say all these

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Nice :) I did it slightly differently. I already had a standard top level Activity all my Activities inherit from so in there i defined: ListCursorAdapter managedCursorAdaptors = new ArrayListCursorAdapter(); and added the following methods: protected void

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Yeah great info all around Kostya thanks :) By the way what is strict mode? I'm coming from a Java Swing environment and only very recently dived into the world of Android so still picking a lot of things up. Thanks Steve -- You received this message because you are subscribed to the Google

[android-developers] Re: Managing Cursor provided to CursorAdapter via a FilterQueryProvider?

2012-01-13 Thread swebb99
Ah very useful thanks Kostya. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

[android-developers] Tools for working with emulator database

2012-01-11 Thread swebb99
Hi, I'm writing an app which makes fairly heavy use of the database. Are there any tools which I can plug into eclipse or use on my Mac which will mean I can quickly view, query and generally mess around with my apps database without me having to use the terminal all the time and constantly exit

[android-developers] Spinners - Saving and Retrieving selection information to DB

2012-01-08 Thread swebb99
Hi, I've got an form activity where I save the information entered in to it to the sqllite database. For the edittext fields this is simple to handle, however I'm not sure of the best practice for handling the storage of spinner selections. If I have a spinner with say the following info in it

[android-developers] Re: Spinners - Saving and Retrieving selection information to DB

2012-01-08 Thread swebb99
when you are adding new items to your SpinnerAdapter just make sure than new items have unique ids and store in the database ids not positions Mmmm when you say id's I'm a little unclear what you mean. I define in an array.xml file the following string-array name=some_demo_array

[android-developers] Re: Spinners - Saving and Retrieving selection information to DB

2012-01-08 Thread swebb99
Im now thinking the way to do this is to take the position of the item selected from the spinner use this as an index in to an associated values array as already mentioned in my last reply, this will then give a value that can be stored. On the reverse route the value fetched from the database

[android-developers] Re: Spinners - Saving and Retrieving selection information to DB

2012-01-08 Thread swebb99
Actually it's easier than I thought. ArrayAdapter takes an array of objects so I can create a simple object that holds the displayable string and the associated value, the tostring() on it will return the displayable string, the getValue() returns the associated value. I then code a simple method

[android-developers] Re: Multiple Apps and Content Providers, How to ?

2011-11-17 Thread swebb99
Ah interesting video thanks for pointing it out to me. It looks like I simply need to use the none server managed purchase mechanism for what I need. The first part of the video was worth watching also because I hadn't even considered security on my app. I think I will spend some time

[android-developers] Re: Multiple Apps and Content Providers, How to ?

2011-11-16 Thread swebb99
Thanks for the reply again Mark, very useful information. The in-app purchasing maybe the way for me to go so I'll have a read around that subject. In theory I could create the structure of the app with several modules which could be purchased as add on's. I could put in the app store a version of

[android-developers] Re: Multiple Apps and Content Providers, How to ?

2011-11-16 Thread swebb99
Right I've had a read around in-app purchasing and I think its the way to go. My thinking is I release the initial version of the code probably without in-app code, just get it out there. Then I do an update when ready which add in-app purchasing. The extra logic to be bought will already be in

[android-developers] Multiple Apps and Content Providers, How to ?

2011-11-15 Thread swebb99
Hi, Newbie here. If I want to create several apps which all allow a user to created, read, update and delete related data so a content provider would seem to be the way to go. However I don't know which app a customer would buy first, second and so on. So how do I make sure that: 1) The first

[android-developers] Re: Multiple Apps and Content Providers, How to ?

2011-11-15 Thread swebb99
at 8:11 AM, swebb99 sweb...@gmail.com wrote: Hi, Newbie here. If I want to create several apps which all allow a user to created, read, update and delete related data so a content provider would seem to be the way to go. However I don't know which app a customer would buy first, second

[android-developers] Re: Multiple Apps and Content Providers, How to ?

2011-11-15 Thread swebb99
Thanks for the reply Mark. As you say contacts is part of the eco system and hence I can see the benefit of a provider. But I'm failing to see how providers created by normals developers like myself are actually that useful unless you have one app that provides the provider and then the others

[android-developers] Existing layouts no longer showing in graphical layout due to null pointer exception!

2011-10-25 Thread swebb99
I updated the android SDK's, basically installed and updated everything. Now when I open existing applications I've been working on I get an error when trying to view existing layouts java.lang.NullPointerException at

[android-developers] Re: Existing layouts no longer showing in graphical layout due to null pointer exception!

2011-10-25 Thread swebb99
18:00, swebb99 пишет: I updated the android SDK's, basically installed and updated everything. Now when I open existing applications I've been working on I get an error when trying to view existing layouts java.lang.NullPointerException

[android-developers] Re: Existing layouts no longer showing in graphical layout due to null pointer exception!

2011-10-25 Thread swebb99
. *Thanks and Regards, Kumar Bibek* *http://techdroid.kbeanie.comhttp://www.kbeanie.com* On Tue, Oct 25, 2011 at 10:39 PM, swebb99 sweb...@gmail.com wrote: Great thanks Kostya that fixed my problem :) Do you know what it fixed by any chance ? Steve On Oct 25, 3:23 pm, Kostya

[android-developers] Re: Existing layouts no longer showing in graphical layout due to null pointer exception!

2011-10-25 Thread swebb99
-developers/DdE5Ql_OZsY https://groups.google.com/forum/#%21topic/android-developers/DdE5Ql_OZsY -- Kostya 25.10.2011 21:09, swebb99 пишет: Great thanks Kostya that fixed my problem :) Do you know what it fixed by any chance ? Steve On Oct 25, 3:23 pm, Kostya Vasilyevkmans