Я создаю навигационный ящик с просмотром Recycler. Раньше он работал, теперь я вдруг получаю Verify Error.Я получаю VerifyError для адаптера RecyclerView
FATAL EXCEPTION: main Process: com.tanmay.androidsupport, PID: 18435 java.lang.VerifyError: com/tanmay/androidsupport/view/adapter/DrawerAdapter at com.tanmay.androidsupport.view.activities.HomeActivity.onCreate(HomeActivity.java:75) at android.app.Activity.performCreate(Activity.java:5264) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5292) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644) at dalvik.system.NativeStart.main(Native Method)
Это мой Выдвижные адаптер -
public class DrawerAdapter extends RecyclerView.Adapter<DrawerAdapter.ViewHolder> {
static final int TYPE_HEADER = 0;
static final int TYPE_ITEM = 1;
Context context;
String[] navTitles;
public DrawerAdapter(Context context, String Titles[]) {
navTitles = Titles;
this.context = context;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == TYPE_ITEM) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.drawer_item, parent, false);
ViewHolder vhItem = new ViewHolder(v, viewType);
return vhItem;
} else if (viewType == TYPE_HEADER) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.drawer_header, parent, false);
ViewHolder vhHeader = new ViewHolder(v, viewType);
return vhHeader;
}
return null;
}
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
if (holder.Holderid == 1) {
holder.drawerItem.setText(navTitles[position - 1]);
} else {
}
}
@Override
public int getItemCount() {
return navTitles.length + 1;
}
@Override
public int getItemViewType(int position) {
if (isPositionHeader(position))
return TYPE_HEADER;
return TYPE_ITEM;
}
private boolean isPositionHeader(int position) {
return position == 0;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
int Holderid;
TextView drawerItem;
public ViewHolder(View itemView, int ViewType) {
super(itemView);
if (ViewType == TYPE_ITEM) {
drawerItem = (TextView) itemView.findViewById(R.id.drawer_option);
Holderid = 1;
} else {
Holderid = 0;
}
}
}
}
Line 75 HomeActivity.java ... Что это? Вот где ваша ошибка: –
@ cricket_007 line 75 'HomeActivity.java - mAdapter = новый DrawerAdapter (это ConstantClass.DRAWER, ConstantClass.DRAWER_ICONS);' Здесь я вызываю класс адаптера ящика – TaNMay