Craig wrote:
> I take that back - it didn't solve my problem; I am still getting null
> from my findViewById call. I had some other code for debugging which
> made it looked like it worked. Could someone spot what I'm doing
> wrong?
> 
> public class Tetris extends Activity {
> ...
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.tetris);
>         view = (TetrisView) findViewById(R.id.tetrisview);
>         // view is null here, but there are no inflation errors in the
> log
>     }
> ...
> }
> 
> public class TetrisView extends View {
> ...
> }
> 
> ...and here is my tetris.xml file:
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
>     >
>       <com.technosabbey.games.tetris.TetrisView
>               android:id="@+id/tetrisview"
>           android:layout_width="fill_parent"
>           android:layout_height="wrap_content"
>           />
> </LinearLayout>

Do you have any evidence that your TetrisView constructor is being called?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.3 Published!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to