@Diane My mistake, since I started developing when 1.6 was released I thought the search manager was the new QSB from 1.6
@AJ My app is crashing too because of the QSR terms in the searchable.xml The problem then becomes how can you access them from 1.6+ without them being seen in 1.5? On Dec 8, 2:13 pm, AJ <[email protected]> wrote: > On Dec 7, 4:25 pm, Dianne Hackborn <[email protected]> wrote:> On Mon, Dec > 7, 2009 at 1:20 PM, AJ <[email protected]> wrote: > > > 1) drawable verses the new drawable-* ... if I don't have an icon in > > > drawable.png will my application be icon-less in 1.5? Do I need to > > > copy one of the new icons in there? If so, which one? > > > If you want to run on pre-1.6 platforms, I would suggest putting your medium > > density bitmaps in drawable/* instead of drawable-mdpi/*. 1.6 and later > > will assume that these are medium density. > > Thank you. > > > > 2) search ... how does the "SEARCH" activity get raised for an > > > application on SDK 1.5 devices (which don't appear to have a hardware > > > search button.) Do I need to add a menu option and raise SEARCH as a > > > sub-activity? [Note: I am 100% confused by search button on all > > > android versions 'cos what I read says SDK 2.0 copes with virtual > > > buttons, yet those devices (in emulator) seem to have hardware ones. > > > What am I missing?] > > > Whether or not there is a search button is really a device thing, and not a > > platform version thing. For example, the G1 has a search key on its hard > > keyboard, and you can assume there will be devices running 2.0 and later > > that don't have a search key. If search is important for your app, you will > > want to have another mechanism to get to it -- often a menu item. > > Thanks, again, that helped a lot. I've added a menu option (although > I'd love to know how to hide that if I could detect a hardware > button.) > > My remaining problem is the search suggestion provider code (which I > took from a 2.0 sample) will compile on SDK 1.5 (I've built a SDK > project to ensure little is hidden by backwards compatibility.) > Anyway, things seem good unless I actually return search suggestions > via a > > /** > * The columns we'll include in our search suggestions. There are > others that could be used > * to further customize the suggestions, see the docs in {...@link > SearchManager} for the details > * on additional columns that are supported. > */ > private static final String[] COLUMNS = { > "_id", // must include this column > SearchManager.SUGGEST_COLUMN_TEXT_1, > SearchManager.SUGGEST_COLUMN_INTENT_DATA, > }; > > The generation is here: > > MatrixCursor cursor = new MatrixCursor(COLUMNS, 0); > for (String ingredient : matching_ingredients) { > cursor.addRow(new String[] { > ingredient, // _id > ingredient, // text1 > ingredient // intent_data (included when > clicking > on item) > }); > } > > I've tried reading SearchManager documentation, but cannot seem to > track down what columns it is expecting (or not expecting) for SDK 1.5 > that causes it to try to get a long when I don't have one. > > Unless I comment that out, I get: > > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): > java.lang.NumberFormatException: Achee > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.Long.parse(Long.java:368) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.Long.parseLong(Long.java:358) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.Long.parseLong(Long.java:323) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.Long.valueOf(Long.java:570) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.database.MatrixCursor.getLong(MatrixCursor.java:245) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.database.CursorWrapper.getLong(CursorWrapper.java:127) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.widget.CursorAdapter.getItemId(CursorAdapter.java:156) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.widget.AutoCompleteTextView.buildDropDown > (AutoCompleteTextView.java:900) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.widget.AutoCompleteTextView.showDropDown > (AutoCompleteTextView.java:843) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.widget.AutoCompleteTextView.onFilterComplete > (AutoCompleteTextView.java:749) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.widget.Filter$ResultsHandler.handleMessage(Filter.java:266) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.os.Handler.dispatchMessage(Handler.java:99) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.os.Looper.loop(Looper.java:123) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > android.app.ActivityThread.main(ActivityThread.java:3948) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.reflect.Method.invokeNative(Native Method) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > java.lang.reflect.Method.invoke(Method.java:521) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run > (ZygoteInit.java:782) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) > 12-08 12:02:21.263: ERROR/AndroidRuntime(808): at > dalvik.system.NativeStart.main(Native Method) > > Any pointers on how I'd track down the cause of this problem? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

