How to use headers into ListView using standard methods?
<p>I have tried to use headers with this code:</p>

<pre><code>String[] strings=new String[]{"1", "2", "3"};
ArrayAdapter adapter=new ArrayAdapter(this, android.R.layout.simple_list_item_1,
        strings);
ListView view=(ListView)findViewById(R.id.listView1);

TextView v=new TextView(this);
v.setTextColor(Color.WHITE);
v.setText("122224");
v.setTextSize(15);
v.setId(54);
v.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
view.addHeaderView(v);
view.setAdapter(adapter);
</code></pre>

<p>But it doesn't work and crushes with exception:</p>

<pre><code>01-21 16:52:14.025: E/AndroidRuntime(16625): Uncaught handler: thread main exiting due to uncaught exception
01-21 16:52:14.035: E/AndroidRuntime(16625): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nda.android/com.nda.android.AndroidActivity}: java.lang.ClassCastException: android.view.WindowManager$LayoutParams
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.os.Looper.loop(Looper.java:123)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread.main(ActivityThread.java:4363)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at java.lang.reflect.Method.invokeNative(Native Method)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at java.lang.reflect.Method.invoke(Method.java:521)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at dalvik.system.NativeStart.main(Native Method)
01-21 16:52:14.035: E/AndroidRuntime(16625): Caused by: java.lang.ClassCastException: android.view.WindowManager$LayoutParams
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.widget.ListView.clearRecycledState(ListView.java:492)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.widget.ListView.resetList(ListView.java:478)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.widget.ListView.setAdapter(ListView.java:420)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at com.nda.android.AndroidActivity.onCreate(AndroidActivity.java:98)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-21 16:52:14.035: E/AndroidRuntime(16625):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
01-21 16:52:14.035: E/AndroidRuntime(16625):    ... 11 more
</code></pre>

<p>Please, give me an example. I hope you can help me, thank you, anyway. </p>
