Android: Create a new class? Or can I use the current Activity?
<p>Really I guess I am looking for a best practice answer. I like to leave applications with the lightest amount of code possible and the least amount of repeated code especially. I have a few Android applications that I have created. My question is, if I create a new Activity which in turn also needs a class to be created of a similar name, should I create the class separate or is there some way that I can keep the class that extends the Activity already? </p>

<p>Here is an example, lets say I want to create a small activity that is related to Pinging an Address. I could implement Parcelable on that Activity and use my Activity as a data holder Class. </p>

<pre><code>public class PingAddress extends Activity implements Parcelable{
public String Scan;
public String ScanName;
public String IpAddress;
public String Timeout;
public String NumberOfPings;

public PingAddress() {

}
    public void onCreate(Bundle bundle) { 
        super.onCreate(bundle);
    }
</code></pre>

<p>What I have been doing is just creating the activity and then creating a separate class, using the example above, called PingAddressData, here is an example of that class.</p>

<pre><code>public class PingAddressData implements Parcelable{
public String Scan;
public String ScanName;
public String IpAddress;
public String Timeout;
public String NumberOfPings;

public PingAddress() {

} 
</code></pre>

<p>Again, I am really looking for best practice here with Android. Does anyone know of repercussions that I would run into if I just implemented Parcelable on an Activity? My main objective is to cut down on code pages. I created a separate Package just to store all of the data classes in that I created, but were really a representation of that Activity.</p>

<p>Thanks</p>
