Android Developer:: Too many classes
<p>PLEASE disnegative me...because I take this really seriously. ):</p>

<p>am I making it too difficult for myself?</p>

<p>Okay, so this is what is going on with my app. I have one main class, let's just say colors. within that class colors, I have five different classes pertaining to it. So I have a purple, blue, pink, yellow and green class. Is there a way I can just include these classes within colors? I just want to make it easier and neater. If I could just have one class instead of SIX classes that would be pretty spiffy. What the colors class does is opens the purple colors link, pink colors link and so on. So it really is not doing much. I just need some direction. I am new to this!</p>

<p>please help!
Cady</p>

<p>Colors class [main class]
this is one of the main classes i am using. this is included in the main class (main.java) it is part of the selecting from a menu using the Activity.</p>

<pre><code>package com.tester.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class Colors extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.links);

    //below are the buttons for the different links (:
    Button pink = (Button) findViewById(R.id.pink);
    Button purple = (Button) findViewById(R.id.purple);
    Button green = (Button) findViewById(R.id.green);
    Button yellow = (Button) findViewById(R.id.yellow);

    pink.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.tester.test.PINK"));
        }
    });

    purple.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.tester.test.PURPLE"));
        }
    });

    green.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.tester.test.GREEN"));
        }
    });

    yellow.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.tester.test.YELLOW"));
        }
    });             
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    }

public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
MenuInflater stuffi = getMenuInflater();
stuffi.inflate(R.menu.main_menu, menu);
return true;
}

public boolean onOptionsItemSelected(MenuItem item){
    switch (item.getItemId()){
    case R.id.menuAbout:
        startActivity(new Intent("com.tester.test.ABOUT"));
        return true;
    }
    return false;
    }
}
</code></pre>

<p>OTHER CLASSES
pink/purple/green/yellow
These are the other classes. I will just post one because they all are similar. They all have the same onCreate Bundle. The only thing different in this is the link. I have four different external links that launch within pink, purple, green, yellow.</p>

<pre><code>package com.tester.test;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class Pink extends Activity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView (R.layout.webview);

    WebView ourStuff = (WebView) findViewById(R.id.webView);
    ourStuff.getSettings().setLoadWithOverviewMode(true);
    ourStuff.getSettings().setUseWideViewPort(true);
    ourStuff.getSettings().setBuiltInZoomControls(true);

    try{
        ourStuff.loadUrl("http://www.google.com/");
    }catch(Exception e){
        e.printStackTrace();
    }
}
}
</code></pre>

<p>PLEASE help me!
I want one class file for colors....not FIVE!</p>

<p>Thanks
Cady</p>
