cwnga / code

code
0 stars 0 forks source link

assignment2 , please review #1

Open cwnga opened 11 years ago

cwnga commented 11 years ago

dear, my assignment 2 version 1 has done, may need sometime to refactor my code / . \ https://github.com/cwnga/code/tree/master/android/week2/android_google_image_searcher

/cc @nesquena @timothy1ee

nesquena commented 11 years ago

Hi @cwnga, looks good overall, you were able to get the filters working and properly query based on them. You got the spinners working (although check out http://developer.android.com/reference/android/widget/AbsSpinner.html#attr_android:entries for simpler static spinner value population i.e android:entries="@array/foo")

Do you have any questions for us about this homework or any of the concepts so far?

cwnga commented 11 years ago

hi , I have a question about menu item, if I use android:onClick in example

``` <----------------------------------- if i add android:onClick="XXX", and i implement XXXfunction , however , it will core dump ```

I am not sure how to use onClick in meun. in my assignment , I use onOptionsItemSelected to handle onClick to trigger function

android:onClick is workable or not in menu?

thanks you

timothy1ee commented 11 years ago

Yes, you can also use onClick. However, an important note is that the expected parameter is MenuItem, not View. For example, I'd expect a method like:

public void fun1(MenuItem menuItem) {
    // Implementation goes here...
}

Note in the future that when you get a core dump, you should look at the exception that got thrown in the LogCat, it will generally give you a pretty good hint as to what the problem is.

cwnga commented 11 years ago

OKOK, got it , thanks a lot!