[android-developers] Re: Null reference for ImageView

2009-06-25 Thread sean.guo
06-25 07:37:52.745: ERROR/AndroidRuntime(1722): Uncaught handler: thread main exiting due to uncaught exception 06-25 07:37:52.774: ERROR/AndroidRuntime(1722): java.lang.RuntimeException: Unable to start activity ComponentInfo {goodteamstudio.rdc/goodteamstudio.rdc.MainMenu}: java.lang.NullPointer

[android-developers] Re: Null reference for ImageView

2009-05-18 Thread steve_macleod
Hi Dianne - yup knocking up a wee pacman game to learn android what gave it away? :) I was using standard drawables until I hit the issue of animating the drawables. Thats when I started looking at ImageViews. It was my understanding that I had to use an ImageView to achieve frame-by-frame an

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Dianne Hackborn
Like I said in your other thread, you probably don't want to be doing this. If I am to assume from your code-snippet that you have some kind of PacMan game, where the game is implemented in a SurfaceView and the PacMan is an ImageView... seriously, you don't want to do this. The purpose of Surfac

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen
>From PacManMainView, you would first get the parent view (the FrameLayout), and from there you can find the ImageView. On Sun, May 17, 2009 at 5:16 PM, steve_macleod wrote: > > So if I had: > > http://schemas.android.com/apk/res/ > android" >    android:layout_width="fill_parent" >    android:

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread steve_macleod
So if I had: http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent"> How would I go about getting a reference to the ImageView from PamManMainView? Thanks again On 18 May, 00:56, Marco Nelissen wrote: > If this is in

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen
If this is indeed the case, then the ImageView isn't actually there, so you can't get a reference to it. On Sun, May 17, 2009 at 4:45 PM, steve_macleod wrote: > > Thanks for the reply. > Ill look into this. What is the best way to get a reference to the > ImageView from the custom view code, if

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread steve_macleod
Thanks for the reply. Ill look into this. What is the best way to get a reference to the ImageView from the custom view code, if this is the case? On 18 May, 00:19, Marco Nelissen wrote: > I'm not 100% sure, but I don't think a SurfaceView can have child > views (since it's not a ViewGroup). >

[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen
I'm not 100% sure, but I don't think a SurfaceView can have child views (since it's not a ViewGroup). On Sun, May 17, 2009 at 2:53 PM, steve_macleod wrote: > > Hi, > I have the following xml layout: > >      android:id="@+id/pacman_main_view" >      android:layout_width="fill_parent" >      an