1
내가 활동에서 확장 할 때, 나는 fragment_main을 수정하고 같은 컨트롤을 찾을 수 :여기서 ActionBarActivity에서 확장하면 XML에 바인딩됩니까?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_main);
MyButton = (Button) findViewById(R.id.button1);
}
을하지만 ActionBarActivity에서에서 확장 나에게 오류를 제공 때이 작업을 수행 할 때, 그래서 내가 언급해야 할 일을 수행하는 방법을 :
/*if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}*/
및
setContentView(R.layout.fragment_main);
을 fragment_main하는 activity_main 설정하지만 난이 정확 믿지 않는다 ...
레이아웃 파일이 R.id.button1 버튼입니까? – joao2fast4u
fragment_main에서 이클립스에서 빈 액티비티를 사용합니다. –
왜 Activity에서 ActionBarActivity를 확장 하시겠습니까? – joao2fast4u