如果屏幕上有视频,Android会调用邮件问题
|
我有一个具有VideoView和共享按钮的活动。触摸共享按钮时,它将调用邮件客户端。这是我的代码:
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.phrasevideo);
//extraDataHelper.getPhraseDetails(phraseId);
btnshare = (ImageView) findViewById(R.id.btnshare);
videoView = (VideoView) findViewById(R.id.VideoView);
File f=new File(Environment.getExternalStorageDirectory(), \"extras/hello.mp4\");
Uri video = Uri.parse(f.getAbsolutePath());
videoView.setVideoURI(video);
btnshare.setVisibility(View.VISIBLE);
}});
videoView.start();
btnshare.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
// TODO Auto-generated method stub
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType(\"text/html\");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{\"\"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, \"Language Hostess\");
String emailText = \"<html><body><p>Hi friends</p></body></html>\";
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailText));
startActivityForResult(Intent.createChooser(emailIntent, \"Email:\"), 1);
return false;
}});
}
一切正常。但是当我在发送或丢弃邮件后回到应用程序时,videoView只是黑色的。在此我要提到的是,共享按钮仅在视频不播放时出现。为什么会这样呢?问题的解决方法是什么?
没有找到相关结果
已邀请:
1 个回复
戊袱