1

With this code, I am able to get the text file. If I replace text file with docx file it shows data in Encoded form and I need to show the text in proper format. Is it possible with .docx file ? or any other solution for that.

try {
    InputStream is=getActivity().getAssets().open("getting_started.txt");
    int size = is.available();
    byte[] buffer = new byte[size];
    is.read(buffer);
    is.close();

    // Convert the buffer into a string.
    String text = new String(buffer);

    // Finally stick the string into the text view.
    tv_help_text.setText(text);

    } catch (IOException e) {
    throw new RuntimeException(e);
}
priyanka kataria
  • 417
  • 5
  • 17

0 Answers0