Dear All;
I am new in android using eclipse; I have created 2 activities
activity.java and activity1.java and I have main.xml and main2.xml

so after launching the application it is starting activity.java which
setview to main.xml
then I created a button click event where I am trying to launch or
switch to the second activity1.java :
 Button b1=(Button)findViewById(R.id.button1);
      b1.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              //alert.show();
                //setContentView(R.layout.main2);
                  String packageName =
activity1.class.getPackage().getName();
                  String packageAndClassName = activity1.class.getName();
                  Intent intent = new Intent().setClassName(packageName,
                  packageAndClassName);
                  startActivity(intent);

           }
           });

I am not sure if that is the right way...

is there any suggestions???

regards...

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