Skip to content

Commit 18a1a50

Browse files
committed
add missing Action.java
1 parent d43a052 commit 18a1a50

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/src/org/renpy/android/Action.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.renpy.android;
2+
3+
import android.content.Context;
4+
import android.content.Intent;
5+
import android.net.Uri;
6+
import android.app.Activity;
7+
import android.util.Log;
8+
9+
public class Action {
10+
11+
static Context context;
12+
13+
/* Deliver some data to someone else
14+
*/
15+
static void send(String mimeType, String filename, String subject, String text, String chooser_title) {
16+
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
17+
emailIntent.setType(mimeType);
18+
/** tryied with String [] emails, but hard to code the whole C/Cython part.
19+
if (emails != null)
20+
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emails);
21+
**/
22+
if (subject != null)
23+
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
24+
if (text != null)
25+
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, text);
26+
if (filename != null)
27+
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+ filename));
28+
if (chooser_title == null)
29+
chooser_title = "Send mail";
30+
context.startActivity(Intent.createChooser(emailIntent, chooser_title));
31+
}
32+
}

0 commit comments

Comments
 (0)