problem with open docx file

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

problem with open docx file

Postby sreehari434 » Thu Jul 28, 2011 12:31 pm

Hi,
i have written a code for open docx file and its working fine in nexus phone but does not work in samsung galexy ace (android 2.2).The code i have used given below ,

Code: Select all
  String appurl="/sdcard/docx.docx"
String extension =
      MimeTypeMap.getFileExtensionFromUrl(appUrl);
      Log.i("extension QQQ ",extension);
      String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
      Log.i("MIME TYPE ",mimeType);
      File fileToRead = new File(appUrl);
      Intent i2 = new Intent();
      i2.setAction(android.content.Intent.ACTION_VIEW);
      i2.setDataAndType(Uri.fromFile(fileToRead), mimeType);
      startActivity(i2);


Pls give me a solution for this.
sreehari434
Freshman
Freshman
 
Posts: 3
Joined: Thu Jan 20, 2011 11:12 am

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests