The default page and the first page is screen I see (main.xml). When I replaced the getApplicationContext(); with "this", it started working. Thanks again for your help.
Regards, Tadej On 3 avg., 07:53, titleist <tadej.ore...@gmail.com> wrote: > Thank you for your help, > > Regards > > On 3 avg., 05:21, Ed <edscha...@gmail.com> wrote: > > > > > I think we're possibly overlooking the simplicity of the question (I > > may be wrong). > > > My assumption is that the "page" you are referring to is the first > > screen you see (main.xml). > > > In your code at the moment you have a Class that extends Activity. In > > this class you will have a method called onCreate that is calling > > something like: setContentView(R.layout.main); > > > If you want another "screen": > > 1.createanewlayout in /res/layout (e.g. myLayout.xml) > > 2.createanewclass that extends Activity (e.g. MyActivity) > > 3. in the onCreate of MyActivity add > > setContentView(R.layout.myLayout); > > 4. in AndroidManifest.xml inside the application node add <activity > > android:name=".MyActivity"></activity> (NB: there is a full-stop > > before the class name) > > 5. in the onClick of your button in your original activity (the one > > that calls setContentView(R.layout.main); and has the button) call > > startActivity(newIntent(this, MyActivity.class)); > > 6. run it and hopefully it will work. > > > Cheers, > > > Ed > > > On Aug 3, 5:47 am, Bob Kerns <r...@acm.org> wrote: > > > > Also -- have you tried using the debugger to debug your problem? > > > > It doesn't sound like it. Had you done this basic step, I think: > > > > 1) You might have found the solution to your problem yourself > > > 2) If not, you would be able to ask a much more specific question. > > > > On Aug 2, 11:50 am, TreKing <treking...@gmail.com> wrote: > > > > > On Mon, Aug 2, 2010 at 6:56 AM, titleist <tadej.ore...@gmail.com> wrote: > > > > > I want to open /createnewpage (just like first page / default page but > > > > > with other functionalities) on button click. > > > > > What is a "newpage", "first page", and "default page"? > > > > > > I've tried tocreatecustom dialog like on this page: > > > > >http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog > > > > > but when i clicked the button my application always crashed. > > > > > What is the stack trace for the crash? How are we supposed to help > > > > without > > > > that key information? > > > > > Although I can probably guess since you're using > > > > getApplicationContext() ... > > > > don't use that function. Use "this". > > > > > > Is Custom dialog solution to my problem or should Icreatenewlayout? > > > > > Depends on what your problem is, which I don't really understand. You > > > > should > > > > clarify what you're trying to do. > > > > > --------------------------------------------------------------------------- > > > > ---------------------- > > > > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > > > > transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en