I have an activity hosting a fragment defined in fragment_hello_moon.xml. The fragment has a VideoView and start and stop buttons. I can get the Views for the start and stop buttons, but I keep getting null when I try to retrieve the VideoView. It's id is in my R.java file.
My fragment code is
The fragment layout file (fragment_hello_moon) is
And my R.java file is
I can't figure why I'm getting null for findViewById(R.id.hellomoon_videoView); Any help would be greatly appreciated
ibrahim yener wrote:First thing catch my eye is you are not importing R file.
Thanks for the reply ibrahim. I don't think I need to include R.java, according to Eclipse the R.id.hellomoon_videoView is resolved since my R.java package is the same as the fragment file's package. However, just for giggles I included it and it did not help.
posted 2 years ago
Mike, try changing android:src to android:id in
No, tomorrow we rule the world! With this tiny ad: