Setando foco

Top  Previous  Next

import android.app.Activity;

import android.os.Bundle;

import android.widget.EditText;

 

public class FocoActivity extends Activity {

 

 EditText ed;

  /** Called when the activity is first created. */

  @Override

  public void onCreate(Bundle savedInstanceState) {

      super.onCreate(savedInstanceState);

       setContentView(R.layout.main);

       

       ed = (EditText) findViewById(R.id.editText3);

       ed.requestFocus();

   }

}