Hi all,

I am trying to extend the ViewGroup in my application.
then from my main activity i will create a variable of type following is the
code snippet

public class NewViewGrp extends Activity {

    Vg V = new Vg(this);    /* Vg is extending the ViewGroup */
    TextView Tv;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        V = (Vg) findViewById(R.id.Layout);
        Tv = (TextView) findViewById(R.id.TextView1);
    }

But when I am running the app it is failing. In logcat i m getting error as
NullPointerException.

What might be the reason?

is it a correct way please tell the correct one.

Thanks,
satish

-- 
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

Reply via email to