Did you step through the debugger with this to see where it is breaking? On Jan 28, 7:58 am, satish bhoyar <[email protected]> wrote: > 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 Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android 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

