Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法解析方法膨胀(android.context.context)_Java_Android_Android Recyclerview - Fatal编程技术网

Java 无法解析方法膨胀(android.context.context)

Java 无法解析方法膨胀(android.context.context),java,android,android-recyclerview,Java,Android,Android Recyclerview,我面临这个方法的问题,它说无法解决方法膨胀(android.context.context) 取代 View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false); 与 LayoutInflater.inflate(parent.getContext())应该是一个LayoutInflater.from(parent.getContext())。尝试

我面临这个方法的问题,它说
无法解决方法膨胀(android.context.context)

取代

View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);


LayoutInflater.inflate(parent.getContext())
应该是一个
LayoutInflater.from(parent.getContext())
。尝试将其添加为答案@wizard好的,谢谢我犯了一个愚蠢的错误,问题解决了now@Wizard将此添加为答案,如果有效,请接受。
View view= LayoutInflater.inflate(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_thighlayout,parent,false);