동일한 액티비티의 backgound 이미지를 여러 번 변경해야합니다. XML이이 경우 도움이되지 않을 수 있으므로 코드를 사용하여 어떻게 할 수 있는지 알고 싶습니다.배경 이미지를 변경하는 방법
여기 내 활동의 코드입니다. 간단하고 줄이 적습니다. 누군가 내가이 코드를 바꿔서 내가 필요한 것을 어떻게 할 수 있는지를 설명 할 수 있다면, 나는 매우 감사 할 것입니다. 감사합니다.
public class forca_inicia extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forca_inicia);
Editable palavra_jogo;
EditText palavra = (EditText)findViewById(R.id.campo_palavra);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_forca_inicia, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
일해 주셔서 감사합니다. –