跳到主要內容

android holder.binding.videoview cannot be played Url

 Recently, Videoview was added to the implementation of RecyclerView, and there was a display error

W/Glide: Cannot find GeneratedAppGlideModule. You should include the annotationProcessor compilation dependency on com.github.bumptech.glide:compiler and AppGlideModule in your application

holder.binding.videoview.getLayoutParams().height = getScreenWidth(context) * 9 /16;
holder.binding.videoview.getLayoutParams().width = getScreenHight(context) * 9 /16;
public static int getScreenWidth(Context c) {
int screenWidth = 0; // this is part of the class not the method
if (screenWidth == 0) {
WindowManager wm = (WindowManager) c.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
screenWidth = size.x;
}

return screenWidth;
}

public static int getScreenHight(Context c) {
int screenHeight = 0; // this is part of the class not the method
if (screenHeight == 0) {
WindowManager wm = (WindowManager) c.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
screenHeight = size.y;
}

return screenHeight;
}


留言

這個網誌中的熱門文章

IOS Swift 在某路徑下產生檔案 txt json

語法:         func createFile(name: String , fileBaseUrl: URL ){             let manager = FileManager . default                          let file = fileBaseUrl. appendingPathComponent (name)             print ( "文件: \ ( file )" )             let exist = manager. fileExists (atPath: file. path )             if !exist {                 let data = Data (base64Encoded: "aGVsbG8gd29ybGQ=" ,options:. ignoreUnknownCharacters )                 let createSuccess = manager. createFile (atPath: file. path ,contents:data,attributes: nil )                 print ( "文件產生结果: \ ( createSuccess )" )             } ...

android eclipse transformation to android studio Error AAPT: error: style attribute 'attr/@attr/colorChecked (aka com.xxxxx:attr/@attr/colorChecked)' not found.

AAPT: error: style attribute 'attr/@attr/colorChecked 刪除 " @attr/" 即可!!