-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShareActivity.java
More file actions
21 lines (16 loc) · 1004 Bytes
/
ShareActivity.java
File metadata and controls
21 lines (16 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.example.ikoala.ui.social;
import android.content.Intent;
import android.content.Context;
import com.example.ikoala.database.BaseActivity;
public class ShareActivity {
public static void openShareOptions(Context mContext, BaseActivity activity){
//use activity to get the name in share message
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Check this out! I've just used the " + activity.getName() +
" activity on the iKOALA app. The app is very useful and I thought it might be of interest to you. It's even got a great list of activities for people with knee osteoarthritis!";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, activity.getName() + " on the iKOALA app");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
mContext.startActivity(Intent.createChooser(sharingIntent, "Share with friends"));
}
}