Hello,

I am trying to create an app for android 1.5 which would be organized
around 4-5 'screen's that will be changing in a given order.

So I start ma app with the first screen, which it's background and a
button. When I click on the button a new screen appears with a
different background and different options which lead to next screens.
Sth. that is usually seen in games. The problem is that I need to pass
a lot of data between those 'screens' like and array with recorded
sound. My idea was to create a separate xml layout file for each
screen and change the context in the activity class so ie:

public class ApiDemos extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.first);
        ((Button)
findViewById(R.id.button1)).setOnClickListener(mButton01Listener);
        //and handle other visible elements.

    }

    OnClickListener mButton01Listener = new OnClickListener() {
        public void onClick(View v) {
                setContentView(R.layout.sec);
               ((Button)
findViewById(R.id.button2)).setOnClickListener(mButton02Listener);
               //and handle other visible elements
               //plus running some functions i.e. start_recroding();
        }

     //and so on and so on...
    };

A simple test app for 3 screens works this way but my I don't really
like this approach and it seems to be inappropriate.

Is this the correct way of organizing such an app in android or should
I take another approach - if I should, please give a more detailed
advice on how to do this.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to