Here is my Code and The problem occurs in Switch Case....plz help
package com.example.atg.adapter;
import com.example.atg.LoginFragment;
import com
The problem is that your RegisterFragment is a android.app.Fragment, but you are returning a android.support.v4.app.Fragment in your getItem(...) method. Check your import statements in both classes where you are importing Fragment and make sure they are either both importing the normal android.app.Fragment or the support library android.support.v4.app.Fragment depending on your application's needs.
the problem is you are importing
import android.app.Fragment;
inside RegisterFragment and
Importing
import android.support.v4.app.Fragment;
inside adapter.
If you are using Support v4 import import android.support.v4.app.Fragment; in RegisterFragment as well.