title: The adapter does not call getView () when using ListView in Fragment
body: <p>So I was faced with yet another "surprise" problem when writing your application. I know that there ListFragment, but using a Fragment. When I put the markup for a fragment of a ListView, when you call the adapter in the list does not function adds elements - not a cunning way I tracked on the logs that you do not call getView (). What is more interesting - if I do not use instead of just a list of the fragment and you add the adapter works well when everything - the list is filled. I can not understand why this is happening - why in the fragment list of works not adequate. </p>
  
  <p><strong>activity_start.xml</strong>  </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"    
      android:descendantFocusability="beforeDescendants"
      android:focusableInTouchMode="true"
      android:scrollbars="vertical"
      android:scrollbarStyle="insideInset"
      android:gravity="center_vertical"
      android:orientation="vertical"
      android:background="#e8e8e8" 
      &gt;
  
  &lt;Button 
      android:id="@+id/button_add_url"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:drawableRight="@drawable/green_add"
      android:drawablePadding="5dp"
      android:text="ADD URL"
      /&gt;    
  
   &lt;LinearLayout
      android:id="@+id/linear_layout_list_show_monitor_url"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/border_background"
      android:orientation="vertical"
      android:padding="1dp"
      android:layout_marginLeft="16dp"
      android:layout_marginRight="16dp"
      &gt;
  
  
     &lt;!--  &lt;ListView
          android:id="@+id/list_view_fragment"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt; --&gt;    
  
       &lt;fragment
           android:id="@+id/fragment_list"
           android:name="pront.android.exservice.FragmentList"
           android:layout_width="match_parent"
           android:layout_height="300dp"/&gt;           
  
   &lt;/LinearLayout&gt;    
  </code></pre>
  
  <p></p>
  
  <p><strong>StartActivity.java</strong></p>
  
  <pre><code>import java.util.ArrayList;
  import pront.android.exservice.FragmentDialogAddNewUrl.FragmentDialogAddNewUrlConectActivity;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.content.pm.ActivityInfo;
  import android.graphics.Typeface;
  import android.graphics.drawable.Drawable;
  import android.os.Bundle;
  import android.support.v4.app.DialogFragment;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.app.FragmentManager;
  import android.util.Log;
  import android.view.Gravity;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.Button;
  import android.widget.LinearLayout;
  import android.widget.ListView;
  import android.widget.TableLayout.LayoutParams;
  import android.widget.Toast;
  
  public class StartActivity 
                          extends FragmentActivity 
                          implements OnClickListener,
                                     FragmentDialogAddNewUrlConectActivity
  {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
      this.getWindow().addFlags
      (WindowManager.LayoutParams.FLAG_FULLSCREEN); 
      setContentView(R.layout.activity_start);
      listViewUrl = (ListView) findViewById(R.id.list_view_fragment);
      screenWidthPx = this.getResources().getDisplayMetrics().widthPixels;
      screenHeightPx = this.getResources().getDisplayMetrics().heightPixels;
      layoutMarginPx = 16;
      screenDp = this.getResources().getDisplayMetrics().density;
      layoutMarginDp = (int)(layoutMarginPx*screenDp);
      typefaceRoboto = Typeface.createFromAsset(getAssets(),
              "Roboto-Thin.ttf");
      LinearLayout linearLayout = (LinearLayout) 
              findViewById(R.id.linear_layout_list_show_monitor_url);
      LayoutParams layoutParams = 
              new LayoutParams(LayoutParams.FILL_PARENT,
                      LayoutParams.WRAP_CONTENT);        
      layoutParams.setMargins(layoutMarginDp, layoutMarginDp,
              layoutMarginDp, layoutMarginDp);
      linearLayout
          .setLayoutParams(layoutParams); 
      buttonAddUrl = (Button) findViewById(R.id.button_add_url);
      buttonAddUrl.setTypeface(typefaceRoboto, Typeface.BOLD);
      buttonAddUrl.setOnClickListener(this);        
      broadcastReceiver = new MyBroadcastReceiver();
      intentFilter = new IntentFilter(BROADCAST);
      registerReceiver(broadcastReceiver, intentFilter);
  }
  
  public void onStart(){
      super.onStart();
  }
  
  public void onRestart(){
      super.onRestart();
  }
  
  public void onResume(){
      super.onResume();
  }
  
  public void onPause(){
      super.onPause();
  }
  
  public void onStop(){
      super.onStop();
  }
  
  public void onDestroy(){
      unregisterReceiver(broadcastReceiver);
      super.onDestroy();
  }
  
  @Override
  public void onBackPressed(){
      super.onBackPressed();
  
  }
  
  public void onClick(View view) {
      if(view.getId() == R.id.button_add_url){
          buttonAddUrl.setClickable(false);
          fragmentDialogAddNewUrl = new FragmentDialogAddNewUrl();
          fragmentDialogAddNewUrl.show(this.getSupportFragmentManager(),
                  "fragmentDialogAddNewUrl");
          buttonAddUrl.setClickable(true);
      }        
  } 
  
  public void fragmentDialogClickButtonListener(String url, 
                                                  String pathFavIcon)
  {
      fragmentDialogAddNewUrl.onDestroyView();        
      this.url = url;
      Toast toastInfo = Toast
                      .makeText(this.getApplicationContext(),
                      "Service start monitor\n"+url,
                      Toast.LENGTH_LONG);
      toastInfo.setGravity(Gravity.TOP, 0, 0);
      toastInfo.show(); 
      arrayListUrl.add(new UrlBox(this.getApplicationContext(),
              url,
              pathFavIcon));
      Log.d("StartActivity", "fragmentDialogClick...() listViewUrl.setAdapter()");
      FragmentList fragmentList = (FragmentList) this.getSupportFragmentManager().findFragmentById(R.id.fragment_list);
      fragmentList.setAdapter(arrayListUrl);
  //        MyListAdapter adapter = new MyListAdapter(this, R.layout.expandable_list_view_child_item, arrayListUrl);
  //        adapter.notifyDataSetChanged();
  //        listViewUrl.setAdapter(adapter);                
  }
  
  public static class MyBroadcastReceiver extends BroadcastReceiver{
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.d("", intent.getIntExtra("RESULT", 0)+"");                      
      }
  
  }   
  
  private Button buttonAddUrl;
  private ListView listViewUrl;
  
  private MyBroadcastReceiver broadcastReceiver;    
  private IntentFilter intentFilter;
  private Typeface typefaceRoboto;
  private DialogFragment fragmentDialogAddNewUrl;
  
  private MyListAdapter myListAdapter = null;
  private ArrayList&lt;UrlBox&gt; arrayListUrl = new ArrayList&lt;UrlBox&gt;();
  private int layoutMarginPx;    
  private float screenDp;
  private int screenWidthPx;
  private int screenHeightPx;
  private int layoutMarginDp;
  private ArrayList&lt;String&gt; childUrl = new ArrayList&lt;String&gt;();
  private ArrayList&lt;Drawable&gt; childFavIcon = new ArrayList&lt;Drawable&gt;();
  private String url;
  private final static String BROADCAST = "pront.android.exservice";
  
  }
  </code></pre>
  
  <p><strong>FragmentList.java</strong></p>
  
  <pre><code>import java.util.ArrayList;
  import android.app.Activity;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  
  public class FragmentList extends Fragment {
  
  @Override
  public void onAttach(Activity activity){ 
      super.onAttach(activity);
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);     
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
      listView = (ListView) inflater.inflate(R.layout.layout_fragment_list, null, false).findViewById(R.id.list_view_fragment);
      return inflater.inflate(R.layout.layout_fragment_list, null, false);
  }
  
  public void setAdapter(ArrayList&lt;UrlBox&gt; arrayList){
      listAdapter = new MyListAdapter(getActivity(), R.layout.expandable_list_view_child_item, arrayList);
      listAdapter.notifyDataSetChanged();
      if(listView != null){
          listView.setAdapter(listAdapter);           
          System.out.println("set adapter");
      }        
  }
  
  MyListAdapter listAdapter;
  ListView listView;  
  
  }
  </code></pre>
  
  <p><strong>MyListAdapter.java</strong></p>
  
  <pre><code>import java.util.ArrayList;
  import android.app.Activity;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  public class MyListAdapter extends ArrayAdapter{
  
  MyListAdapter(Activity context, int layoutResourceId, ArrayList&lt;UrlBox&gt; arrayList) {
      super(context, layoutResourceId);
      Log.d("MyListAdapter", "constructor");
      this.context = context;
      this.arrayListUrlBox = arrayList;
      this.layoutResourceId = layoutResourceId;
  }
  
  @Override
  public View getView (int position, View convertView, ViewGroup parent){
      Log.d("MyListAdapter", "getView");
      View returnView = convertView;
      ListItemTagHolder tag  = null;
      if(convertView == null){
          LayoutInflater inflater = context.getLayoutInflater();
          returnView = inflater.inflate(layoutResourceId, null, false);
          tag = new ListItemTagHolder();
          tag.ImageViewFavicon = (ImageView) returnView.findViewById(R.id.image_view_favicon);
          tag.ImageViewStatus = (ImageView) returnView.findViewById(R.id.image_view_status);
          tag.TextViewUrl = (TextView) returnView.findViewById(R.id.text_view_url);
          returnView.setTag(tag);
      }
      else{
          tag = (ListItemTagHolder) returnView.getTag();
      }
      tag.ImageViewFavicon.setImageDrawable(arrayListUrlBox.get(position).getDrawableFavIcon());
      tag.ImageViewStatus.setImageDrawable(arrayListUrlBox.get(position).getDrawableFavIcon()); // !
      tag.TextViewUrl.setText(arrayListUrlBox.get(position).getUrl());
      return returnView;      
  }
  
   @Override
   public int getCount() {
       return arrayListUrlBox.size();
   }
  
   public UrlBox getItem(int position) {
       return arrayListUrlBox.get(position);
   }
  
  private ArrayList&lt;UrlBox&gt; arrayListUrlBox;
  private Activity context;
  private int layoutResourceId;
  
  static class ListItemTagHolder{
      protected ImageView ImageViewFavicon;
      protected ImageView ImageViewStatus;
      protected TextView TextViewUrl;
  }   
  }
  </code></pre>