小编Amn*_*rza的帖子

如何播放当前焦点在回收站视图中的视频视频视频

在我的应用程序中有一个带有视频视图的回收器视图,我想自动播放滚动时完全聚焦的特定视频视图.

android scrollview autoplay android-videoview android-recyclerview

4
推荐指数
1
解决办法
5264
查看次数

Facebook分享视频例外"分享视频必须在Android上引用设备上的视频"

我正在Facebook Android sdk 4.6.0通过Gradle 使用.

我试图根据Facebook指南上的分享配置Facebook后从移动目录上传视频,但我得到例外"ShareVideo必须引用设备上的视频",在sharedialog.show调用之后.通过对onError(FacebookException异常)的回调向我报告异常.

/**first checking if file exist than execute code, file exits and code execute but after executing callback with exception "Share Video must reference a video that is on the device" occurs
 **/      private void shareOnFacebook() {
                    File dir = new File(Environment.getExternalStorageDirectory(),
                            "directory");
                    File video = new File(dir, "Video.mp4");
                    if (video.exists()) {//if video file exist
                        Uri videoFileUri = Uri.parse(video.getPath());
                        ShareVideo sv = new ShareVideo.Builder()
                                .setLocalUrl(videoFileUri)
                                .build();
                        ShareVideoContent content = new ShareVideoContent.Builder() …
Run Code Online (Sandbox Code Playgroud)

android facebook facebook-sharer facebook-share facebook-exception

3
推荐指数
1
解决办法
512
查看次数

Android如何关闭正在运行的应用程序?

如何在主要活动的背面退出应用程序?我正在使用此代码,但它完成主要活动并显示来自后台的其他活动.

@Override
    public void onBackPressed() {
        finish();
    }
Run Code Online (Sandbox Code Playgroud)

android onbackpressed

2
推荐指数
1
解决办法
7650
查看次数