Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25363

Android: Intents should use ContentProvider

    Details

    • Story Points:
      3
    • Sprint:
      2017 Sprint 20 SDK

      Description

      • As of Android 7.0, Intents should use a ContentProvider to provide the DATA URI of created Intents.

      TEST CASE

      var extFile = Ti.Filesystem.getFile(Ti.Filesystem.externalStorageDirectory, 'test.pdf'),
          openPDF = function(pdf) {
              Ti.Android.currentActivity.startActivity(
                  Ti.Android.createIntent({
                      action : Ti.Android.ACTION_VIEW,
                      type : 'application/pdf',
                      data : pdf.nativePath
                  })
              );
          };
       
      if (extFile.exists()) {
          openPDF(extFile);
      } else {
          var httpClient = Titanium.Network.createHTTPClient({
              onload: function() {
                  extFile.createFile();
                  extFile.write(this.responseData);
                  openPDF(extFile);
              }
          });
          httpClient.open('GET','https://github.com/mozilla/pdf.js/raw/master/examples/helloworld/helloworld.pdf');
          httpClient.send();
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                gmathews Gary Mathews
                Reviewer:
                Joshua Quick
                Tester:
                Lokesh Choudhary
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5855
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code