i just want to open SkipActivity from MondayFragment, and fail in error. The swipe between fragments is work, but when i click on skip button move to another Activity- the app is crushed(closed):
All relevant code is attached, please help:
        public class MondayFragment extends Fragment {
            final String LOG_TAG="myLogs";
            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                View v=inflater.inflate(R.layout.fragment_monday, container, false);
              TextView txt=(TextView) v.findViewById(R.id.skip);
              txt.setOnClickListener(new View.OnClickListener() {
                  public void onClick(View v) {
                      ((TextView)getActivity().findViewById(R.id.skip)).setText("Access from Monday Fragment");
                      //Start your activity here
                      Intent i = new Intent(getActivity(),SkipActivity.class);
                      startActivity(i);
              }
          });
          return v;
        }
       }
This is java Activity class :
public class SkipActivity extends AppCompatActivity {
    @Override
    protected void onCreate( Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.after_skip_scr);
    }
}
This is MainActivity class - i think there is nothing to change here:
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Set the content of the activity to use the activity_main.xml layout file
        setContentView(R.layout.activity_main);
        // Find the view pager that will allow the user to swipe between fragments
        ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
        // Create an adapter that knows which fragment should be shown on each page
        SimpleFragmentPagerAdapter adapter = new SimpleFragmentPagerAdapter(getSupportFragmentManager());
        // Set the adapter onto the view pager
        viewPager.setAdapter(adapter);
    }
}
Below is res-layout files: The first one is for monday fragment
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/monday_main"
    android:background="#a7cbeb">
    <TextView
        android:id="@+id/welcome_message"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:layout_centerInParent="true"
        android:textColor="#191970"
        android:text="Welcome to Circles"
        android:textSize="29sp"
        />
    <TextView
        android:id="@+id/skip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="54px"
        android:textStyle="italic"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="25dp"
        android:layout_marginTop="25dp"
        android:text="skip"
        android:textColor="#ffffff"
        android:onClick="openSkipActivity"
        />
</RelativeLayout>
And this one is for main activity:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="MainActivity">
    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>
 
     
     
     
     
    