Exemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (isOnline()) {
      super.setContentView(R.layout.fragment_progress);
    } else {
      setErrorView();
    }
  }
Exemplo n.º 2
0
 public void setContentView(int layoutResId) {
   if (layoutResId == R.layout.error) {
     super.setContentView(layoutResId);
   } else {
     LayoutInflater layoutInflater = LayoutInflater.from(this);
     View contentView = layoutInflater.inflate(layoutResId, null);
     setContentView(contentView);
   }
 }
Exemplo n.º 3
0
 @Override
 protected void onStart() {
   if (!hasErrorView()) {
     ensureContent();
     if (mContentView == null) {
       throw new IllegalStateException("Content view must be initialized before");
     }
   }
   super.onStart();
 }