getData returns the activity data, either as a map, or for a
specific key.
public Map<String, String> getData()
public Map<String, String> getData() returns the
activity data as a map.
Parameters
None
Returns
Returns a Map<String, String> instance that represents a map of all extra data specific to a certain type of activity.
Example
ActivityStreamService activityStreamService = session.getServiceRegistry() .getActivitystreamService(); try { // Get all entries List<ActivityEntry> entries = activityStreamService.getActivityStream(); // get data for first entry Map<String, String> map = new HashMap<String, String>(); map = entries.get(0).getData(); Log.d(TAG, "DATA_START:"); for (String key : map.keySet()) { Log.d(TAG, "key: " + key + " value: " + map.get(key)); } Log.d(TAG, "DATA_END."); // get value for specified key Log.d(TAG, "feedUserId: " + entries.get(0).getData("feedUserId")); } // end try catch (AlfrescoServiceException e){ Log.d(TAG, "Exception:" + e.toString()); return 1; }
Would result in output such as:
public String getData(String key)
public String getData(String key) returns the activity
data for the specified key.
Parameters
- String key
- A string representing the key associated with the specific data item whose value is to be returned.
Returns
Returns a String instance that represents a data value corresponding to the specified key.
Example
ActivityStreamService activityStreamService = session.getServiceRegistry() .getActivitystreamService(); try { // Get all entries List<ActivityEntry> entries = activityStreamService.getActivityStream(); // get data for first entry Map<String, String> map = new HashMap<String, String>(); map = entries.get(0).getData(); Log.d(TAG, "DATA_START:"); for (String key : map.keySet()) { Log.d(TAG, "key: " + key + " value: " + map.get(key)); } Log.d(TAG, "DATA_END."); // get value for specified key Log.d(TAG, "feedUserId: " + entries.get(0).getData("feedUserId")); } // end try catch (AlfrescoServiceException e){ Log.d(TAG, "Exception:" + e.toString()); return 1; }
Would result in output such as: