package com.example.mukullashkari.onlinetestportal;
import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class Tab1_fragment extends Fragment {
Button btnC;
public static Tab1_fragment newInstance(int sectionNumber) {
Tab1_fragment fragment = new Tab1_fragment();
return fragment;
}
public Tab1_fragment()
{
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
btnC=(Button) btnC.findViewById(R.id.C_btn);
btnC.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent myIntent=new Intent(Tab1_fragment.this,Cassessment.class);
startActivity(myIntent);
}
}
);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.tab1_fragment,container,false);
}
}
I have created Cassessment activity.But the error is coming in Intent Constructor. Says that constructor cannot be resolved. What is wrong in this code can anyone help !!
ERROR IS::
Cannot resolve constructor 'Intent(com.example.mukullashkari.onlinetestportal.Tab1_fragment, java.lang.Class)'