Android Get Resource / Buffer Reader Problems
My code seems to run but it does not display the result any result on text view am guessing is because of the way I set my code. The code is below Somebody please help me. Thanks
Solution 1:
Regarding your code:
button.setOnClickListener(newView.OnClickListener() {
publicvoidonClick(View v) {
CCActivity3fs=newCCActivity3();
fs.fileReader();
}// button
});// button end
Is CCActivity3 derived from an Activity? If so, then you shouldn't construct it this way. You can't instantiate your own Activity class. Only the Android framework can do that. What seems to be happening here is that inside fileReader(), you are calling getResources() on an Activity whose Context has not yet been properly initialized by onCreate().
In any case, one thing you can do is call fileReader() method directly without instantiating CCActivity3, like so:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
fileReader();
}// button
});// button end
Solution 2:
test = CCActivity3.getPermutation(s);//Permutation method test2.retainAll(test);//intersection
Above codes can get the right return?
Post a Comment for "Android Get Resource / Buffer Reader Problems"