Switching Layouts

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Switching Layouts

Postby travisjames » Fri Apr 03, 2009 5:11 pm

I have my main class named HelloAndroid.class and I have it try and switch to HelloAndroid2.class on button click and for some reason this code crashes my application.

I have heard you have to ass <intent-filter>, into AndroidManifest.xml, but I do not know how to do that or what I should put for this to switch screens to that class. Is there anyway I can accomplish all of this? Here is the code I have been trying to use.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent myIntent = new Intent(HelloAndroid2.class);
  2.  
  3.           startActivity(myIntent);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


But for some reason, this does not work. Can anyone shed some light on this?

EDIT: I have also tried this code and it still crashes my application:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent myIntent = new Intent(HelloAndroid.this,HelloAndroid2.class);
  2.  
  3.           startActivity(myIntent);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
travisjames
Junior Developer
Junior Developer
 
Posts: 17
Joined: Thu Apr 02, 2009 10:00 pm
Location: Cordova, Tennessee

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests