[android-developers] Re: IllegalStateException after ListView's adapter has changed

2012-09-20 Thread Doug Turner
Jayesh Salvi gmail.com> writes: > > > Hi,This is regarding the exception:  "java.lang.IllegalStateException: The content of the adapter has > changed but ListView did not receive a notification." - seen on Android 1.6+This problem has been discussed in the past [1][2][3][4], and I have fol

[android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread Zsolt Vasvari
In a background thread's constructor, retrieve the global context using getApplicationContext(). Then you can use that to look up resources, it works, I do it all over. On Jan 26, 12:49 am, elDoudou wrote: > Thank you Kostya. > > Yes, my intent is to invoke those methods from a worker backgroun

[android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread elDoudou
Thank you Kostya. Yes, my intent is to invoke those methods from a worker background thread. You assume that I want to get i18n string to update the UI, but this is not my exact use case. I need to get an i18n string, because I want to prepare the computation of a string (imagine that the string

[android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread Kostya Vasilyev
( responding back to the list ) Yes, that was my point. Even if each individual framework method you're calling was be thread-safe (which it may not be) , overall, your code sequence is not thread safe. Mark already gave one suggestion. Here is another: Since you're talking about getting strin

Re: [android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread Mark Murphy
On Wed, Jan 25, 2012 at 9:06 AM, elDoudou wrote: > If you implement "Fragment.getContext()" the following way, I think > that it works: getView().getContext() may not return a context that is safe to use from a background thread. It could easily be the last Activity associated with that View, and

Re: [android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread Kostya Vasilyev
Do you expect to run this code on a background worker thread? If so, how are you ensuring that the UI thread won't change the fragment's state while this code is running? 25 января 2012 г. 18:06 пользователь elDoudou написал: > Thank you Mark. > > If you implement "Fragment.getContext()" the fo

[android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread elDoudou
Thank you Mark. If you implement "Fragment.getContext()" the following way, I think that it works: public final Fragment.getContext() { if (isDetached() == true) { if (getView() == null) { throw new IllegalStateException("..."); } return getView().getContext()"; } els

Re: [android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread Mark Murphy
On Wed, Jan 25, 2012 at 8:44 AM, elDoudou wrote: > Yes sure, this is a way to address this issue. But if the i18n string > I need to get depends on the result of a web service call, this means > that I need to provide all i18n strings at AsyncTask build time. Or, you do the lookup in onPostExecut

[android-developers] Re: "IllegalStateException Fragment not attached to Activity": a challenging issue?

2012-01-25 Thread elDoudou
Thank you Mark. Yes sure, this is a way to address this issue. But if the i18n string I need to get depends on the result of a web service call, this means that I need to provide all i18n strings at AsyncTask build time. And if I need to use the "getString(int resourceId, ...)" form? In that case,

[android-developers] Re: IllegalStateException: Scheme 'https' not registered.

2011-10-04 Thread William Ferguson
Ta. I've been using a DefaultHttpClient with a ThreadSafeClientConnectionManager (wonder why I decided I needed that) and in order to construct the ThreadSafeConnectionManager I needed to pass in a SchemeRegistry in which I had only been registering http (since I was only accessing a http address)

Re: [android-developers] Re: IllegalStateException: Scheme 'https' not registered.

2011-10-03 Thread Nikolay Elenkov
On Tue, Oct 4, 2011 at 1:33 PM, William Ferguson wrote: > >> As for the https error, even if you are not trying to access an HTTPS URL, >> there might be a proxy in-between, or some other redirect. Especially on >> public WiFi networks, people get redirected to all sorts of intermediary >> sites

[android-developers] Re: IllegalStateException: Scheme 'https' not registered.

2011-10-03 Thread William Ferguson
On Oct 4, 1:32 pm, Nikolay Elenkov wrote: > Are you using a single instance of DefaultHttpClient from multiple threads? > A bit unlikely, but might be a multi-threading issue. You can try to > explicitly initialize a ThreadSafeClientConnectionManager with SchemeRegistry > and all and pass that t

Re: [android-developers] Re: IllegalStateException: Scheme 'https' not registered.

2011-10-03 Thread Nikolay Elenkov
On Tue, Oct 4, 2011 at 7:15 AM, William Ferguson wrote: > Anyone? > > It's affecting about 0.1% of my users. > More in AUS, UK and Germany than in the states > Across all versions of Android from 1.6 to 2.3.3 (I don't support 1.5 > and the numbers for 3.0+ are probably too low to have generated an

[android-developers] Re: IllegalStateException: Scheme 'https' not registered.

2011-10-03 Thread William Ferguson
Anyone? It's affecting about 0.1% of my users. More in AUS, UK and Germany than in the states Across all versions of Android from 1.6 to 2.3.3 (I don't support 1.5 and the numbers for 3.0+ are probably too low to have generated any errors). Surely someone else is seeing this for http addresses.

Re: [android-developers] Re: IllegalStateException: Can not perform this action after onSaveInstanceState - How to prevent?

2011-09-28 Thread Kostya Vasilyev
No, the change I'm talking about is in the platform itself, so would be seen with or without the compatibility package - if running on 3.*, and your targetSdk is set to 11 or greater (maybe it's not, then it must be something else). 28.09.2011 13:41, b0b ?: The error is rare then be

Re: [android-developers] Re: IllegalStateException: Can not perform this action after onSaveInstanceState - How to prevent?

2011-09-28 Thread b0b
> > The error is rare then because fewer than 1.5% of devices are running > Android 3.*: > > Not when using the compat package (android.support.v4.*). Anyway to be clear, this exception is super rare in my app using the compat package 2.x devices. -- You received this message because you are

Re: [android-developers] Re: IllegalStateException: Can not perform this action after onSaveInstanceState - How to prevent?

2011-09-28 Thread Kostya Vasilyev
This might be due to the subtle changes in activity lifecycle callbacks starting with Andorid 3.0: http://developer.android.com/reference/android/app/Activity.html >> Be aware that these semantics will change slightly between applications targeting platforms starting with|HONEYCOMB

[android-developers] Re: IllegalStateException: Can not perform this action after onSaveInstanceState - How to prevent?

2011-09-28 Thread b0b
I've seen reports of that error although they are so rare that I didn't bother with it. In my case it happen with the compat library. Also in a TabActivity. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email

Re: [android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2011-06-15 Thread Petroleum Nasby
Sometimes when you call stop(), you can't immediately call prepare(), even though the state diagram says you can. The state diagram varies from reality, and the current programming model forces the developer to assume what the state is based on the APIs that were called, and when any variance from

[android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2011-06-15 Thread Jona
I know this thread is old, but why not call stop() and that's it. After you can call start(). Or just call reset() and when you need to prepare again just setDataSource() and prepareAsync(). -Jona On Jun 15, 7:30 am, Petroleum Nasby wrote: > Issue #800 has been open since 2008. > > It's unbeliev

Re: [android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2011-06-15 Thread Petroleum Nasby
Issue #800 has been open since 2008. It's unbelievable that three years later, one still cannot determine the state of the MediaPlayer. I hate to kvetch, but Android makes me kvetch more that just about any platform. Regards P. V. Nasby On Sat, Nov 27, 2010 at 7:38 AM, Jason wrote: > Thanks

Re: [android-developers] Re: IllegalStateException: Fragment not added in ActionBarTabs example

2011-05-20 Thread Mark Murphy
On Fri, May 20, 2011 at 2:29 PM, Dianne Hackborn wrote: > Lots of votes for bugs just makes me want to ignore the bug.  Just saying. Is there another mechanism on b.android.com to subscribe to an issue without voting for it? > I hate bug voting.  Drives me crazy. There's no question that it's f

Re: [android-developers] Re: IllegalStateException: Fragment not added in ActionBarTabs example

2011-05-20 Thread Dianne Hackborn
Lots of votes for bugs just makes me want to ignore the bug. Just saying. I hate bug voting. Drives me crazy. On Fri, May 20, 2011 at 11:23 AM, Ed Burnette wrote: > Ok, I've entered a bug report. See/vote for: > http://code.google.com/p/android/issues/detail?id=17029 . Thanks. > > On May 19,

[android-developers] Re: IllegalStateException: Fragment not added in ActionBarTabs example

2011-05-20 Thread Ed Burnette
Ok, I've entered a bug report. See/vote for: http://code.google.com/p/android/issues/detail?id=17029 . Thanks. On May 19, 2:46 pm, Shane Isbell wrote: > I've run into this on occasion, I surrounded it with a general Exception > catch to handle this, which seemed to have no side affects for my > a

[android-developers] Re: IllegalStateException: database not open

2011-03-01 Thread Indicator Veritatis
I can answer only your smaller question: if you want to delete the database file by hand (using adb shell) you will have to 'root' your phone. Otherwise, as you already mentioned, you do not even have the permissions to even cd to that directory. On Feb 28, 7:35 pm, javaxmlsoapdev wrote: > Just g

Re: [android-developers] Re: IllegalStateException: database not open

2011-03-01 Thread Kostya Vasilyev
Yes, it's very strange - unless you subclassed SQLiteOpenHelper, the database files for both applications should be in their respective private data directories, not on the memory card. Those directories are only accessible by the application they belong to, and you can't browse them (from the

[android-developers] Re: IllegalStateException: database not open

2011-02-28 Thread javaxmlsoapdev
Just got a chance to resume this issue. How to search the device for the database file? Apparently something really strange is going on or I am doing something wrong. Shouldn't databases be private by default? I haven't done anything special to make them public. databases aren't on the memory card.

Re: [android-developers] Re: IllegalStateException: database not open

2011-02-21 Thread Mark Murphy
2011/2/21 javaxmlsoapdev : > yes. both apps are uninstalled but unable to remove database from the > phone, which originally was created by app1 (and subsequently app2 > used the same db name, which screwed up the things)? That's not possible, AFAIK. An uninstall should remove all files. > how to

Re: [android-developers] Re: IllegalStateException: database not open

2011-02-21 Thread Kostya Vasilyev
Each application has its own private data files, including the databases. Uninstalling should remove those. So either somehow the files didn't get removed (which is strange by itself), or else something even more strange is going on. Are the databases, perhaps, not private to the respective a

[android-developers] Re: IllegalStateException: database not open

2011-02-21 Thread javaxmlsoapdev
yes. both apps are uninstalled but unable to remove database from the phone, which originally was created by app1 (and subsequently app2 used the same db name, which screwed up the things)? I also tried context.deleteFile(DATABASE_NAME); context.deleteDatabase(DATABASE_NAME); withou

[android-developers] Re: IllegalStateException: database not open

2011-02-20 Thread javaxmlsoapdev
Anyone? On Feb 15, 9:37 pm, javaxmlsoapdev wrote: > I had an existing working application which was creating a database > using SQLite helper/code. In another application, which I am > developing I copied app1's DBHelper code and honestly forgetting to > rename the database name in the DBHelper,

[android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2010-11-27 Thread Jason
Thanks for the advice. I had already modeled the state transitions using the listeners, however I suspect there is (was) a problem with the rules I had implemented in this regard. Because the call to prepareAsync returns immediately, I think a subsequent call to prepareAsync was coming in and fai

[android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2010-11-26 Thread joebowbeer
Do you have an error listener registered? Does it give you more information? According to the state diagram, stop() is not available in all states. Perhaps you're calling stop() in an invalid state, causing the player to transition to the Error state, at which point prepareAsync would fail: http:

[android-developers] Re: IllegalStateException in MediaPlayer (Redux)

2010-11-23 Thread Jason
Whoa.. what's with the double post?? On Nov 23, 8:16 pm, Jason Polites wrote: > Hi folks, > > Some time ago I posted an issue relating to an IllegalStateException > in the Media Player (http://groups.google.com/group/android-developers/ > browse_thread/thread/46c7c2cd4f4a6958/5551d47aac93632c) >

[android-developers] Re: IllegalStateException in MediaPlayer (HTC Hero 1.5)

2010-09-27 Thread Jason
Thanks, but actually I "think" I have solved the problem. Although I'm not 100% sure how or why this exception was thrown, it seems the MediaPlayer is not in the state I expect it to be. My solution is to wrap the MediaPlayer instance and implement my own state indicator. So when the MediaPlayer

Re: [android-developers] Re: IllegalStateException in MediaPlayer (HTC Hero 1.5)

2010-09-27 Thread Prajakta Shitole
I was just wondering if you could try to use setDataSource again before making a call to prepareAsync.. not sure if that is the problem as i have not seen the complete code.. but you could try.. Thanks, Prajakta On Fri, Sep 17, 2010 at 7:42 PM, Jason wrote: > Anyone?.. Bueller... > > On Sep 18,

[android-developers] Re: IllegalStateException in MediaPlayer (HTC Hero 1.5)

2010-09-17 Thread Jason
Anyone?.. Bueller... On Sep 18, 5:20 am, Jason wrote: > Hi all, > > I'm running into some state problems with MediaPlayer.  I have so far > only seen this on one device (HTC Hero) running Android 1.5.  Stack > trace is: > > java.lang.IllegalStateException >        at android.media.MediaPlayer.pre

[android-developers] Re: IllegalStateException with ExpandableListActivity and SimpleCursorTreeAdapter

2010-09-17 Thread Kumar Bibek
On the very first line... Adapter that exposes data from a Cursor to a ListView widget. The Cursor must include a column named "_id" or this class will not work. Here. http://developer.android.com/reference/android/widget/CursorAdapter.html -Kumar Bibek http://techdroid.kbeanie.com On Aug 30, 8

[android-developers] Re: IllegalStateException with ExpandableListActivity and SimpleCursorTreeAdapter

2010-08-29 Thread OldSkoolMark
Documented where? On Aug 28, 4:17 pm, Kumar Bibek wrote: > Yup, you are right, It's well documented I guess. > > -Kumar Bibekhttp://techdroid.kbeanie.com > > On Aug 27, 11:47 pm, OldSkoolMark wrote: > > > I've resolved the issue. Not sure if this is a bug, feature, or is > > merely an undocument

[android-developers] Re: IllegalStateException with ExpandableListActivity and SimpleCursorTreeAdapter

2010-08-28 Thread Kumar Bibek
Yup, you are right, It's well documented I guess. -Kumar Bibek http://techdroid.kbeanie.com On Aug 27, 11:47 pm, OldSkoolMark wrote: > I've resolved the issue. Not sure if this is a bug, feature, or is > merely an undocumented feature. It appears that the child projection > you supply to your Ex

[android-developers] Re: IllegalStateException with ExpandableListActivity and SimpleCursorTreeAdapter

2010-08-27 Thread OldSkoolMark
I've resolved the issue. Not sure if this is a bug, feature, or is merely an undocumented feature. It appears that the child projection you supply to your ExpandableListAdapter's constructor needs to include the _ID field of the child table. -- You received this message because you are subscribed

[android-developers] Re: IllegalStateException

2010-04-29 Thread ulqui
up plz On 29 avr, 17:15, ulqui wrote: >   hello > >   i have a custom view with BaseAdapter which list all my mp3 files in > SD card >   it works great but the getCount have a problem if i want return the > size of my song list >  indeed , i have a illegalStateException : "content of the adapter

[android-developers] Re: IllegalStateException

2010-01-26 Thread Vic
Hi all, I have a question. Does the cursor error cause SQLiteException? I also have the following information in the log file. I am confused.Do the two exception ( IllegalStateException and SQLiteException) will occur together if I don't close one of cursors? Thank you. 01-14 21:02:53.262 E/Androi

[android-developers] Re: IllegalStateException: not connected to MediaScannerService?

2009-12-14 Thread blindfold
Today I received yet another instance of this crash problem, again on a Droid with Android 2.01: java.lang.IllegalStateException: not connected to MediaScannerService at android.media.MediaScannerConnection.scanFile (MediaScannerConnection.java:148) at blah.blah.blah.onMediaScannerConnected(Unknow

[android-developers] Re: IllegalStateException when calling Preference.setDependency()

2009-07-03 Thread ccdesignz
First of all, sorry for my bad english. I found the answer in the android sdk source code, the problem is the following: When your "CheckBoxPreference" or an other "Preference" class call the setDependency() method, this one will call the following method: "PreferenceManager.findPreference()" in

[android-developers] Re: IllegalStateException when calling Preference.setDependency()

2009-07-01 Thread ccdesignz
I have the same problem :( have you an answer ? On Jun 4, 11:43 pm, flix wrote: > Hello, > > I'm trying to create a PreferenceScreen with a CheckBoxPreference > which depends on an other CheckBoxPreference using thesetDependency() > method, as shown in the code below. > > While calling thesetDe