I have commented out the ((Button) findViewById(R.id.addClockIn)).setOnClickListener(this) section and it doesn't crash but the buttons will not work.
public class MainActivity extends Activity implements OnClickListener {
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
((Button) findViewById(R.id.addClockIn)).setOnClickListener(this);
}
}
public void addClockIn(View view) {
StringBuilder str = new StringBuilder("It worked");
textView.setText(str);
}