I am trying to set a breakpoint inside an Activity class:
public class MainActivity extends Activity {
private EditText htmlContent = null;
private Button getBtn = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); // <<<< this is where I set a breakpoint
htmlContent = (EditText)findViewById(R.id.htmlContent);
getBtn = (Button)findViewById(R.id.get);
// anonymous inner class implementing OnClickListener
getBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
// fill htmlContent using HTTP GET
try {
final TestHttpGet thgObj = new TestHttpGet();
thgObj.executeHttpGet();
}
catch (Exception e){
// do something meaningful here
}
}});
// start some activity here?
getBtn.setEnabled(true);
}
}
Now, the funny thing is that this program runs and I can even see its layout screen in the emulator, but when I click the getBtn nothing happens, and so I tried to set a breakpoint inside to see why.
The amazing thing is… No breakpoint is ever reached – even if I set it on the first statement in OnCreate(). How is this possible???
Maybe mine is a stupid question, but… Are you running the program normally? or using the debug button?