Ben wrote: > To anybody responding to this. I've actually figured out that the > problem is not that search doesn't know what directory to look in. > It's that if I do not go through the typical onDestroy()...onCreate() > cycle. If I have already loaded a resource, that resource seems to be > held in memory somewhere, because menus I have not called yet will > show up correctly, but the ones I've already invoked once will not.
Try using onPrepareOptionMenu() instead of onCreateOptionMenu(). Or, call clear() on the Menu object in onConfigurationChanged(). > It seems a little strange since each time I'm inflating the view for > the menu I'm reinitializing the Dialog box I'm using with dialog=new > Dialog(); and making a call to dialog.setContentView(R.layout.xxxx) > where xxxx is my desired view. You did not discuss this in your original post, so I am not quite sure what you are talking about. > I guess it must cache the view, or its > location in memory somewhere and not reinitialize until the > onDestroy()...onCreate() cycle runs. If this is a managed dialog, it is probably caching the dialog, not the view. You probably should be calling removeDialog() for any managed dialogs you created in your activity when that activity gets called with onConfigurationChanged(). > If anybody knows how to get R to reinitialize its pointers to these > resources it would help quite a bit R does not change on an orientation change. You can examine the source code to R yourself -- it is in the gen/ folder of your project. It is just a bunch of numbers, given labels via public static data members. The Resources object changes (not sure if it's a different instance or just loads different stuff -- never really looked at that), but R does not. >> In my application, I want to override the default reorientation from >> androids for two reasons: >> >> 1) my main view is animated and the redraw routine checks for changes >> in the screen height >> >> 2) It is faster to not reload everything again >> >> 3) My application allows users to decide what positions they would >> like things in, and I would like the positions to be proportional to >> the last position before the orientation switch, not in the default >> position I know, onSaveInstanceState, but again it is faster to just >> let the refresh routine handle the changes. Since you appear to have implemented this, I am assuming that you: -- have an appropriate android:configChanges attribute in your manifest -- have overridden onConfigurationChanged() to do something -- are chaining to the superclass in onConfigurationChanged() >> Anyway, I have a bunch of custom menus that reside in both the layout >> and layout-land folders. I would like the program to take the proper >> menu based on that, but it doesn't. So I'm looking for the method >> that is called somewhere between onCreate and onResume that tells the >> program which xml documents to use. First, whatever it is, it is not called between onCreate() and onResume(), since you can use resources in onCreate(). Second, whatever it is, I do not think it is exposed in the API. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.0 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe from this group, send email to android-beginners+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

