mercredi 4 juin 2014

Android - Array of findviewbyID?


Vote count:

0




In my code, I have the following array:


public TextView[] realtext = {(TextView) findViewById(R.id.onetext),(TextView) findViewById(R.id.twotext),(TextView) findViewById(R.id.threetext),(TextView) findViewById(R.id.fourtext),(TextView) findViewById(R.id.fivetext),(TextView) findViewById(R.id.sixtext), (TextView) findViewById(R.id.seventext),(TextView) findViewById(R.id.eighttext)};


For some reason this gives me a null pointer exception? How can I make an array like this?



asked 34 secs ago






Aucun commentaire:

Enregistrer un commentaire