Ah, that did the trick.  Thank you very much, it was setting the
Intent that I was totally missing.

On Aug 21, 10:04 am, Appaholics <raghavs...@appaholics.in> wrote:
> You need to declare the second activity in the manifest. You will also need
> an intent in your first activity to launch the second one. 
> Thishttp://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-bet...
> help you in adding and starting another activity.
>
> Thanks
>
> On Sun, Aug 21, 2011 at 8:27 PM, erik wagner <erik.j.wag...@gmail.com>wrote:
>
>
>
>
>
> > Hi,
> > This is I'm sure a very simple thing to do and I am just missing
> > something but I am just starting out.  I have the main view, which has
> > a button.  The button brings up a second view that is supposed to show
> > some toast message (or, in fact do anything).  I can get everything to
> > work on the first view, but nothing at all to work on the second.
> > first view (main.xml for the layout)
> > public class actvSecondPage extends Activity {
> >    @Override
> >    public void onCreate(Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.main);
>
> >        final Button btnToast = (Button) findViewById(R.id.btnToast);
> >        btnToast.setOnClickListener(new OnClickListener() {
> >                public void onClick(View v) {
> >                        Toast.makeText(actvSecondPage.this, "this is some
> > toast",
> > Toast.LENGTH_LONG).show();
> >                }
> >        });
>
> >        final Button btnSecondPage = (Button)
> > findViewById(R.id.btnSecondPage);
> >        btnSecondPage.setOnClickListener(new OnClickListener() {
> >                public void onClick(View v) {
> >                        setContentView(R.layout.second);
> >                }
> >        });
> >    }
> > }
>
> > Second view (second.xml for the layout)
> > public class actvSecond extends Activity {
> >    @Override
> >    public void onCreate(Bundle savedInstanceState) {
> >        super.onCreate(savedInstanceState);
> >        setContentView(R.layout.second);
>
> >                Toast.makeText(actvSecond.this, "this is some toast on the
> > actual
> > second page.", Toast.LENGTH_LONG).show();
> >    };
> > }
> > the android.manifest.xml (in case i'm missing something there)
> > <?xml version="1.0" encoding="utf-8"?>
> > <manifest xmlns:android="http://schemas.android.com/apk/res/android";
> >      package="com.SecondPage"
> >      android:versionCode="1"
> >      android:versionName="1.0">
> >    <uses-sdk android:minSdkVersion="3" />
>
> >    <application android:icon="@drawable/icon" android:label="@string/
> > app_name">
> >        <activity android:name=".actvSecondPage"
> >                  android:label="@string/app_name">
> >            <intent-filter>
> >                <action android:name="android.intent.action.MAIN" />
> >                <category
> > android:name="android.intent.category.LAUNCHER" />
> >            </intent-filter>
> >        </activity>
>
> >    </application>
> > </manifest>
>
> > Can anyone help as to why what works in the first class does not in
> > the second?  Or, rather, that nothing at all works in the second
> > class?  Any help would be appreciated, thanks.
> > Erik
>
> > --
> > 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
>
> --
> ------------------
> Raghav Sood
> CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles
> required to have complete 
> control)http://www.raghavsood.com/https://market.android.com/developer?pub=Appaholicshttp://www.appaholics.in/

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

Reply via email to