On Activity:
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
// on tab selected
// show respected fragment view
Log.
Your Text is :
int strtext=getArguments().getInt("Nilai", 0);
It should Be:
int strtext=getArguments().getInt("nilai", 0);
Edit :
Check Out this Question which is Related to your Problem:
Here
public class MyFragment extends Fragment {
int strtext;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Bundle data = getArguments();
strtext= data.getInt("Nilai");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.lirik_view, container, false);
Log.v("Testing", "Menjalankan proses pengambilan data dari activity");
Log.v("Testing", "Data adalah "+strtext);
return rootView;
}
}