Context context = getActivity().getApplicationContext();
context.bindService(new Intent(context, VpnStateService.class),
mServiceConnection, Service.BIND_AUTO_CREATE);
+ /* hide it initially */
+ getFragmentManager().beginTransaction().hide(this).commit();
}
@Override
public void updateView()
{
FragmentTransaction ft = getFragmentManager().beginTransaction();
- ft.show(this);
switch (mService.getImcState())
{
case ISOLATE:
mStateView.setText(R.string.imc_state_isolate);
mStateView.setTextColor(getResources().getColor(R.color.warning_text));
+ ft.show(this);
break;
case BLOCK:
mStateView.setText(R.string.imc_state_block);
mStateView.setTextColor(getResources().getColor(R.color.error_text));
+ ft.show(this);
break;
}
ft.commit();