Validating and reading a Word file in Android

前端 未结 6 1796
忘了有多久
忘了有多久 2020-12-05 16:19

I want to be able to access a word file in the sdcard of the user\'s phone, and the file will be chosen by the user. I want to be able to process the file, i.e. read its con

6条回答
  •  余生分开走
    2020-12-05 16:49

    If you want to edit the data directly, just do an intent to an available text editor.

    Intent intent = new Intent(Intent.ACTION_EDIT); 
    Uri uri = Uri.parse("file:///"+file.getAbsolutePath()); 
    intent.setDataAndType(uri, "plain/text"); 
    startActivity(intent);
    

提交回复
热议问题