title: android: Can i use different class for different child of viewflipper
body: <p>I have different screen to work in an android application.
  I'm using ViewFlipper for this.
  I decided to used different class for different view children </p>
  
  <pre><code>public main extends Activity{
  {
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.sign_in);
      ViewFlipper viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
  
  HomeScreen s = new HomeScreen(getApplicationContext(), getCurrentFocus(), viewFlipper);
    }
  } 
  </code></pre>
  
  <p>and this the Homescreen class is :-</p>
  
  <pre><code>public class HomeScreen {
  private Button signIn;
  private Button createAccount;
  private View v;
  private Context context;
  private ViewFlipper viewflipper;
  
  public HomeScreen(Context context,View v,ViewFlipper viewflipper ) {
   this.v=v;
   this.context = context;
   this.viewflipper = viewflipper;
  
  
   signIn = (Button) v.findViewById(R.id.button_sign_in_homeScreen);
   createAccount = (Button)v.findViewById(R.id.button_createAccount_homeScreen);
   signIn.setOnClickListener(new View.OnClickListener() {
   public void onClick(View v) {
     viewflipper.setDisplayedChild(1);
    }
   });   
  }
  </code></pre>
  
  <p>but is shows run exception 
  java.lang.RuntimeException: Unable to start activity ComponentInfo
  Can anyone please help me<br>
  is getCurrentFocus() is the correct way to get the view?  </p>
  
  <hr>
  
  <p><strong>What i try to implement is</strong>  </p>
  
  <ul>
  <li>I need to use different class for defining, listening the controls of each child of view flipper </li>
  <li>In the above example HomeScreen is one of my the child screen of view flipper</li>
  <li>But the line <code>v.findViewById</code> is showing error <em>i think that getCurrentFocus() is not the correct way to sent the view</em></li>
  </ul>
  
  <p>I don't know weather i'm moving in the correct way? When i define and listen all the controls of all children of viewflipper in the Class where i define that viewflpper, that class become very big. That made me to think so.. </p>
  
  <p>Thanks...</p>