1

I am not sure whether it is applicable or not in an Android?

I had received an email with an attached .CSV file...Now when I will click on that attachment then It could give me an option to open this attachment in xyz application..I want to implement this only on .csv attached file.

Please give me some hint that Is it possible ??

Thanks..

Kanika
  • 10,328
  • 17
  • 58
  • 77

2 Answers2

2

If it's your app, I believe you just have to associate that file type with the app using the Android manifest. See this question for details:

Android intent filter: associate app with file extension

Community
  • 1
  • 1
Ken Fehling
  • 1,821
  • 20
  • 28
  • But what is the use of this..I mean the practical one, what would happen when I associate .csv file type with myapplication? – Kanika Mar 02 '12 at 06:20
  • Whenever someone goes to open a CSV file and they have your app installed it will give them a choice to open it with your app or other apps that can open CSV files. If it's the only app on the device that can open a CSV file, it will automatically open in your app. – Ken Fehling Mar 02 '12 at 06:29
1

As the @Ken Fehling suggested, you must approach this way.
What actually gonna happen by this is, when you click on the attchment after its downloaded, Android OS will ask you and give a option containing all the apps that can open .csv file.
Now as you have mentioned the mime type or android:pathPattern in your app, the option list will contain the name of your app too.

akkilis
  • 1,884
  • 14
  • 21