Changes

Jump to navigation Jump to search
Line 140: Line 140:  
             fd.close()
 
             fd.close()
 
         return data
 
         return data
 +
</pre>
 +
 +
 +
=== How do I programmatically make my activity available for sharing? ===
 +
 +
Use the share() method that is included in the Activity class. This method takes a boolean argument that specifies whether the sharing should be private (only visible to those buddies that are invited to share) or public (visible to the entire neighborhood).
 +
 +
The following code shows how to share the activity with all buddies in your neighborhood:
 +
 +
<pre>
 +
from sugar.activity import activity
 +
...
 +
class AnnotateActivity(activity.Activity):
 +
    #### Method: __init__, initialize this AnnotateActivity instance
 +
    def __init__(self, handle):
 +
        ...
 +
        self.share(private=False)
 +
        ...
 
</pre>
 
</pre>
  
Anonymous user

Navigation menu