I seem to be overlooking something quite obvious with my loop, but in its present state it is not posting the content of the eula text file to the alert dialog. Anyone see anything I am overlooking? There are 21 lines in the text file. Thanks!
Resources res = getResources();
InputStream in_s = res.openRawResource(R.raw.eula);
BufferedReader reader = new BufferedReader(new InputStreamReader(in_s));
String key1 = preference.getKey();
//if the user click on the Legal Notices preference, display the license
if (key1.equalsIgnoreCase("prefEULA")){
String eulaContent = null;
try {
while ((reader.readLine()) != null)
for(int i=0;i<21;i++){
{
eulaContent = reader.readLine();
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Builder eulaDialog = new AlertDialog.Builder(this);
eulaDialog.setTitle("End-User Licence Agreement");
if (eulaContent!=null){
eulaDialog.setMessage(eulaContent);
eulaDialog.show();
}
}