私は次のような状況があります。上のそれはFINAL宣言する必要が(nome.getText()== null)の場合は、他の私はそれにアクセスできるようにUIオブジェクトを「final」として宣言する必要がありますか?
にアクセスするために
public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.createcharacter); //Referenciando Items do Layout Button voltar = (Button) findViewById(R.id.voltar); Button criar = (Button) findViewById(R.id.criar); final TextView nome = (TextView) findViewById(R.id.nome); ........... criar.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { if(portraitSelected == false) { Toast.makeText(CreateCharacter.this, "Selecione um Avatar", Toast.LENGTH_SHORT).show(); Toast.makeText(CreateCharacter.this, nome.getText(), Toast.LENGTH_SHORT).show(); } else if(nome.getText() == null) { Toast.makeText(CreateCharacter.this, "Digite um Nome!", Toast.LENGTH_SHORT).show(); } .......
を
イムonCreate()メソッドの始まりです。それは問題ありませんか? もしそうなら、どうすればいいですか?
それはその通りです。 – mibollma