This code shows a View window, and displays a text document in HTML format.
I think the function is clear so:
All colors and formats work, but the font all comes in a default size and is rather small.
-I want to customize the font size.
-And I want to customize the background color of the page as well.If there are other additions that can improve the presentation, I would be grateful to you
Button btn_azkar = (Button)findViewById(R.id.btn_azkar);
btn_azkar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
help();
}
@SuppressWarnings("deprecation")
public void help() {
try {
InputStream inputStream = getAssets().open("azkar.txt");
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader BR = new BufferedReader(inputStreamReader);
String line;
StringBuilder msg = new StringBuilder();
while ((line = BR.readLine()) != null) {
msg.append(line + "\n");
}
AlertDialog.Builder build = new AlertDialog.Builder(Info_Activity.this);
build.setTitle(R.string.azkar);
// build.setIcon(R.drawable.icon);
build.setMessage(Html.fromHtml(msg + ""));
build.setNegativeButton(R.string.dilog_close, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
//Negative
}
}).show();
} catch (IOException e) {
e.printStackTrace();
}
}
});