He comprobado los datos que debe mostrar son verdaderos mediante un toast que los imprime, pero al querer mostrar en el TextView (lecciones_count) el dato nteoria no lo hace, ni aunque le ponga que muestre un Hola. pero en donde actualizo progreso_general si lo hace.
el valor de nteoria es 1.
Codigo:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v;
v = inflater.inflate(R.layout.fragment_principal, container, false);
progreso(v);
return v;
}
public void progreso(View v){
TextView progreso_general = (TextView)v.findViewById(R.id.General_Count);
ProgressBar progreso_general_bar = (ProgressBar)v.findViewById(R.id.General_bar);
int total = totalejercicios+totalteoria;
progreso_general.setText(String.valueOf(c)+" %");
progreso_general_bar.setMax(total);
progreso_general_bar.setProgress(nejercicios+nteoria);
TextView lecciones_count = (TextView)v.findViewById(R.id.lecciones_count);
ProgressBar lecciones_bar = (ProgressBar)v.findViewById(R.id.lecciones_bar);
Toast toast1 = Toast.makeText(getContext(),String.valueOf(nteoria), Toast.LENGTH_SHORT);
toast1.show();
lecciones_count.setText(String.valueOf(nteoria).concat("/").concat(String.valueOf(totalteoria)));
lecciones_bar.setMax(totalteoria);
lecciones_bar.setSecondaryProgress(totalteoria);
lecciones_bar.setProgress(nteoria);
TextView ejercicios_count = (TextView)v.findViewById(R.id.ejercicios_count);
ProgressBar ejercicios_bar = (ProgressBar)v.findViewById(R.id.ejercicios_bar);
lecciones_count.setText(String.valueOf(nejercicios)+"/"+String.valueOf(totalejercicios));
lecciones_bar.setMax(totalejercicios);
lecciones_bar.setSecondaryProgress(totalejercicios);
lecciones_bar.setProgress(nejercicios);
}
XML`
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="50sp"
android:paddingTop="15sp"
android:text="@string/lecciones"
android:textSize="26sp" />
<TextView
android:id="@+id/lecciones_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0/0"
android:textSize="32sp" />
</LinearLayout>`