Question: I have a architecture question about legacy.
 For example I have a class that using everywhere in project. Projects don't have any Unit Tests

```
 public class LegacyObject 
    {
      public Dictionary<string, string[]> MyLegacyProperty { get;set;} 
    } 

```

I need to change dictionary type to other type for example `IEnumerable<KeyValuePair<TKey, TValue>>`. 
 What is the best way to change it and don't change the part of code where dictionary MyLegacyProperty using.

Answer: 
Like Dhego, I used a content provider. Specifically, a FileProvider.

<https://developer.android.com/reference/android/support/v4/content/FileProvider.html>

Using this only requires that you modify your Manifest and create an additional resource file. Also, you will need to obtain a validly formatted URI via a static method provided by FileProvider.

In your Manfiest:

```
    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.example.authority.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
     </provider>

```

The "com.example.authority.fileprovider" is your application authority with "fileprovider" appended.

In the res/xml folder, create a file\_paths.xml file that contains the paths to the files you want to expose. In my case, I was exposing them from the application cache directory, so my XML looks like:

```
    <paths xmlns:android="http://schemas.android.com/apk/res/android">
        <cache-path name="reports" path="reports/"/>
    </paths>

```

In my case, "reports" is a folder within the application cache directory that I am writing files to.

The last thing to do is in your code:

1. Write files you want to expose to the folders and storage areas specified in file\_paths.xml.
2. Generate a valid URI to set on the Intent you will invoke for sending an email (Intent.ACTION\_SEND).

Here's some sample code:

```
emailIntent.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(getActivity(), "com.example.authority.fileprovider", fileToAttach));

```

Invoke startActivity on your Intent and that should be it!
It appears that there is indeed [an issue with gmail](http://code.google.com/p/android/issues/detail?id=18872). Unfortunately however, at the time of the writing it seems it hasn't been fixed.