@Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
final String ApplicationPackageName = stringList.get(position);
final String ApplicationLabelName = apkInfoExtractor.GetAppName(ApplicationPackageName);
Drawable drawable = apkInfoExtractor.getAppIconByPackageName(ApplicationPackageName);
viewHolder.textView_App_Name.setText(ApplicationLabelName);
viewHolder.imageView.setImageDrawable(drawable);
}
我必须在哪里使用单击侦听器?我该怎么办?
这是MainActivity,我在其中定义了点击监听器,但是当我使用此代码时仍然出现错误。
//This Method is defined in Adapter Class
@Override
public void onClickedMethod(int position) {
Log.d(TAG,"onClickedMethod"+stringList.get(position));
}