小编use*_*517的帖子

发送包含多个附件的电子邮件

我正在尝试发送包含多个附件的电子邮件.

Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"email1@email.com", "email2@email.com"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "The Text");
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
emailIntent.setType("text/plain");
startActivity( Intent.createChooser(emailIntent, "Send Email Using: ") );
Run Code Online (Sandbox Code Playgroud)

当我使用gmail发送电子邮件时,这很有用,但如果我使用Nexus One上的电子邮件客户端发送电子邮件,它不会附加附件.它包含所有文本,主题等...但只是没有附件.我有的电子邮件帐户是一个交换帐户,如果这很重要...

email android attachment android-intent

6
推荐指数
1
解决办法
7752
查看次数

使NFC/Beam更加自动化

我正在为我的应用添加NFC/Beam功能,我希望它尽可能自动地工作.我想摆脱发送者的"触摸光束"屏幕和接收器的"新标签扫描"屏幕.基本上,我希望它像在三星商业中一样工作!我在stackoverflow中读到似乎可能没有办法摆脱"Touch To Beam"屏幕,但我希望有人有一些更新的信息或知道如何删除接收器屏幕.谢谢!

android nfc android-beam nfc-p2p hce

5
推荐指数
1
解决办法
2755
查看次数

当有人安装Android SD卡时防止崩溃

我在SD卡上打开了一个文件.当有人安装SD卡时,它会崩溃我的应用程序.我正在尝试注册ACTION_MEDIA_EJECT广播事件,我收到了,但似乎我得到的太迟了.当我得到它时,它已经崩溃了我的应用程序.在崩溃我的应用程序之前有没有办法得到通知?

添加了一些非常简单的示例代码 当我这样做时,当我打开USB(MSC模式)时,它会崩溃服务.

Test.java

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    try {
        startService(new Intent(this, TestService.class));
        bindService(new Intent(this, TestService.class), serviceConnection, Context.BIND_AUTO_CREATE);
    } catch (Exception e) {

    }
}

protected TestService testService;
private ServiceConnection serviceConnection = new ServiceConnection() {

    @Override
    public void onServiceConnected(ComponentName name, IBinder service) {
        TestService.LocalBinder binder = (TestService.LocalBinder) service;
        testService = binder.getService();
    }

    @Override
    public void onServiceDisconnected(ComponentName name) {
        testService = null;
    }

};
Run Code Online (Sandbox Code Playgroud)

TestService.java

@Override
public void …
Run Code Online (Sandbox Code Playgroud)

android mount sd-card broadcastreceiver

4
推荐指数
2
解决办法
6104
查看次数