Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid get resource / Buffer reader problems
    primarykey
    data
    text
    <p><strong>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</strong> </p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main3); Button button = (Button) findViewById(R.id.but); input = (EditText) findViewById(R.id.editTextj); display = (TextView) findViewById(R.id.textView8); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { CCActivity3 fs = new CCActivity3(); fs.fileReader(); }// button });// button end } public void fileReader() { try { InputStream is=this.getResources().openRawResource(R.raw.file); BufferedReader bc = new BufferedReader(new InputStreamReader(is)); String cLine; String inputText = ""; List&lt;String&gt; test2 = new ArrayList&lt;String&gt;(); // read file line by line while ((cLine = bc.readLine()) != null) { inputText = inputText + cLine + "\n"; } s = input.getText().toString(); test = CCActivity3.getPermutation(s);//Permutation method test2.retainAll(test);//intersection String fg = ""; for (String s2 : test2) { fg += s2 + "\n"; } display.setText(fg); bc.close(); } catch (Exception e) {// catch any errors if necessary display.setText(e.getMessage()); } } </code></pre> <p>If you check the resource line am very sure am not getting that right and also the formating of the code I believe they just scattered . Hint the file.txt on the res/raw path has more than 100,000 strings/words, could this be the cause.Thanks Again</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload