首先,我的RecyclerView项目没问题,但在滚动时,项目显示在错误的位置,例如:项目6显示在位置67.虽然onClick listener和getAdapterPosition()工作正常并显示正确的项目.为什么?
import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.neganet.darotabii.R;
import com.neganet.darotabii.beans.headers_Bean;
import java.util.List;
public class FSecAdapter2 extends RecyclerView.Adapter<FSecAdapter2.mViewHolder> {
private static List<headers_Bean> items_t;
private static int secNo;
private Typeface font;
private boolean showSoreName;
private static Context mContext;
private static String ?olorString;
private static String fSubjectText="";
private static Static_Datas static_datas;
private static QDataGetter dataGetter;
public FSecAdapter2(List<headers_Bean> t_items, Context cnt, int secNo) {
setHasStableIds(true);
this.mContext=cnt;
this.items_t = t_items;
this.static_datas=new Static_Datas(mContext);
this.secNo=secNo;
}
public …Run Code Online (Sandbox Code Playgroud) 在 Java 中,我们有 Awaitility 类,在其中我们可以等待布尔返回方法返回 true 或 false。
对于 void 方法我们如何做到这一点?
两个查询都会给出相同的结果,"AS"会有什么不同吗?如果是的话,它是什么?如果没有,那么使用它有什么意义呢?
我有一个现有的数据库。需要添加具有默认值的新非空列。使用 ValueGenerator 接口在 hibernate 4.3 中可以完成同样的操作。但是我的项目有 hibernate 3.6,它不提供此功能。有什么方法可以使用冬眠。
我试图从文本文件中读取一行,但程序仍然返回一个错误,指出无法找到该文件的名称.关于如何解决问题的任何想法.
源代码:
import java.io.FileReader;
import java.io.BufferedReader;
public class Cipher {
public String file_name;
public Cipher(){
file_name = "/Users/SubrataMohanty/IdeaProjects/CaesarCipher/src/cipher_text.txt";
}
public static void main(String[] args) {
BufferedReader br = null;
FileReader fr = null;
Cipher cipher_1 = new Cipher();
fr = new FileReader(cipher_1.file_name);
br = new BufferedReader(fr);
String current_line;
while ((current_line = br.readLine()) != null){
System.out.println(current_line);
}
}
}
Run Code Online (Sandbox Code Playgroud)
经过调试,这就是我得到的,
Error:(25, 14) java: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
Error:(30, 43) java: unreported exception java.io.IOException; must …Run Code Online (Sandbox Code Playgroud) java ×3
android ×1
async-await ×1
asynchronous ×1
database ×1
file ×1
hibernate ×1
mysql ×1
oracle ×1
sql ×1
sql-server ×1