locked
How do I open a docx/xlsx document from it's URL, inside a web view ? RRS feed

  • Question

  • User335627 posted

    I am trying to open a docx/xlsx document with the help of its URL in the Android web view. I am passing the document URL in the LoadURL method. But every time I pass a document URL, the web view goes blank. I am able to access web pages inside the web view though.

    I tried opening documents that were on my google drive, through their link. In this case, I was able to open both types of the documents.

    I need help on how do I access any docx/xlsx document with the help of its URL inside the Android web view.

    Wednesday, January 3, 2018 6:53 AM

All replies

  • User101185 posted

    use this code-Device.OpenUri(new Uri("filepath or http url"));

    Wednesday, January 3, 2018 1:49 PM
  • User335627 posted

    @pratiuskumardubey thanks for the response buddy but I am not able to use this code for my solution. The device class seems to have no method named OpenUri plus it shows that it has been deprecated.

    If you can provide an alternative solution.

    PS: I am working in Visual Studio.

    Monday, January 8, 2018 4:06 AM
  • User12885 posted

    What is the code you are trying to use? Are the documents local or on the web?

    Tuesday, January 9, 2018 3:27 AM
  • User335627 posted

    @Corwyn I am trying to load the doc by passing its link in the LoadUrl method of the web view.

    The documents I am trying to load are on the web.

    Do you have a solution for the same ?

    Tuesday, January 9, 2018 4:25 AM
  • User101185 posted

    Convert the all doc file in PDF and try to open in Web view. Because doc file cannot render with web view directly. and please try to post a code what stuff you are trying.

    Tuesday, January 9, 2018 7:07 AM
  • User12885 posted

    That is a description of the code, not the code itself. Show us a code snippet of what you are trying to do so that we can see if there is anything obviously wrong.

    Tuesday, January 9, 2018 1:41 PM
  • User395581 posted

    @sameerpurohit said: I am trying to open a docx/xlsx document with the help of its URL in the Android web view. I am passing the document URL in the LoadURL method. But every time I pass a document URL, the web view goes blank. I am able to access web pages inside the web view though.

    I tried opening documents that were on my google drive, through their link. In this case, I was able to open both types of the documents.

    I need help on how do I access any docx/xlsx document with the help of its URL inside the Android web view.

    Same problem I am facing in android studio while accessing online excel file url in WebView directly

    Saturday, July 4, 2020 8:10 AM