title: nullPointerException when setting adapter for a ListView on SherlockFragmentActivity
body: <p>Please your help, I got a nullpointerexception when trying to set an adapter for a ListView, the listview is lv, I am using SherlockFragmentActivity, for some reason the listView is null, I have performed clear in eclipse and check the name of id in the xml many times, sd is not null, I already used a printout to check it. Here is my code:</p>
  
  <p>LeaderboardActivity.java:</p>
  
  <pre><code>public class LeaderboardActivity extends SherlockFragmentActivity{
  
  private int mMenuID = R.menu.leaderboard;
  ArrayList&lt;HashMap&lt;String,String&gt;&gt; playerList;
  ListView lv;
  SimpleAdapter sd;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_leaderboard);
  
      // enable up button in action bar
      ActionBar actionBar = getSupportActionBar();
      actionBar.setDisplayHomeAsUpEnabled(true);
  
           lv = (ListView) findViewById(R.id.leaderboardListView);
          new LeaderboardList().execute(this);
  
          sd=new SimpleAdapter(this,playerList,R.layout.leaderboard_row,new String[]{"name","email","score"},new int[]{R.id.playerNameTextView,R.id.badgeTextView,R.id.scoreTextView});
          lv.setAdapter(sd);
  }
  </code></pre>
  
  <p>activity_leaderboard.xml:</p>
  
  <pre><code>&lt;RelativeLayout 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"
  tools:context=".LeaderboardActivity" &gt;&lt;!-- Mijail (04-11-2013), leaderboard --&gt;
  
  &lt;LinearLayout
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" &gt;
  &lt;ListView
      android:id="@+id/leaderboardListView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1" &gt;
  &lt;/ListView&gt;
  &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>leaderboard_row.xml:</p>
  
  <pre><code>&lt;RelativeLayout 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" &gt;
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
      &lt;TextView
          android:id="@+id/badgeTextView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView" /&gt;
      &lt;TextView
          android:id="@+id/playerNameTextView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView" /&gt;
      &lt;TextView
          android:id="@+id/scoreTextView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView" /&gt;
  &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The logcat:</p>
  
  <pre><code>    11-06 19:43:37.814: E/AndroidRuntime(7639): FATAL EXCEPTION: main
      11-06 19:43:37.814: E/AndroidRuntime(7639): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.ifgi.sitcom.campusmapper/de.ifgi.sitcom.campusmapper.activities.LeaderboardActivity}: java.lang.NullPointerException
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.os.Handler.dispatchMessage(Handler.java:99)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.os.Looper.loop(Looper.java:137)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread.main(ActivityThread.java:5103)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at java.lang.reflect.Method.invokeNative(Native Method)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at java.lang.reflect.Method.invoke(Method.java:525)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:112)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at dalvik.system.NativeStart.main(Native Method)
      11-06 19:43:37.814: E/AndroidRuntime(7639): Caused by: java.lang.NullPointerException
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.widget.SimpleAdapter.getCount(SimpleAdapter.java:93)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.widget.ListView.setAdapter(ListView.java:463)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at de.ifgi.sitcom.campusmapper.activities.LeaderboardActivity.onCreate(LeaderboardActivity.java:71)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.Activity.performCreate(Activity.java:5133)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      11-06 19:43:37.814: E/AndroidRuntime(7639):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
  </code></pre>