Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old February 7th, 2012, 09:51 PM   #1 (permalink)
New Member
 
Join Date: Feb 2012
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help needed switching activities

I have a lab (project) that I need done for school in order to know how to do the first assignment. The lab introduces both changing activities and passing variables from one activity to another.

The second part of that, I understand how to do... I think... I just don't know how to change from one activity to the next.

The overview of the project is here: CSCI 153 Lab

Uploaded is the code that I'm working with. I've already taken advantage of the search feature of the forum, but found nothing that truly helps.

To cut to the chase, here's the code that I have regarding the button-press to change the activity
Code:
    public void submit(View v){
        String orientation = editO.getText().toString();
        String item1 = edit1.getText().toString();
        String item2 = edit2.getText().toString();
        String item3 = edit3.getText().toString();
        Intent intent = null;
        
        if(orientation.equals("H")){
            intent = new Intent (this, Horizontal.class);
        }
        if(orientation.equals("V")){
            intent = new Intent (this, Vertical.class);
        }
            intent.putExtra("Text1",item1);
            edit1.setText(orientation);
            intent.putExtra("Text2",item2);
            intent.putExtra("Text3",item3);
            startActivity(intent);
    }
Attached Files
File Type: zip MultipleActivitiesLab.zip (62.3 KB, 0 views)

Kelvari is offline  
Reply With Quote
Sponsors
Old February 8th, 2012, 05:02 PM   #2 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

What is the issue you are having? At a glance, the code seems fine.
jonbonazza is online now  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 12:16 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo