0
VideoView와 공유 버튼이있는 활동이 있습니다. 공유 버튼을 누르면 메일 클라이언트가 호출됩니다. 여기 내 코드는 다음과 같습니다.화면에 동영상이있는 경우 Android에서 메일 문제가 발생합니다.
/** 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는 검은 색입니다. 여기서 공유 버튼은 동영상이 재생되지 않을 때만 나타납니다. 왜 그런가? 문제의 해결책은 무엇입니까?