Android Development: pass information and fail
<p>I got 2 classes in my project. The first class(main) have a listview and this is the onclick():</p>

<pre><code>@Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);
        // Get the item that was clicked
        Object o = this.getListAdapter().getItem(position);
        String keyword = o.toString();
        class2 sec = new Class2();

        Intent intent = new Intent(this, Class2.class);
        startActivity(intent) ;
        if (keyword == "hello"){
            sec.setInfo(keyword);
        }



    }
</code></pre>

<p>so and then in my other class which have a defferent layout.xml. The code is:</p>

<pre><code>public class det extends Activity {
    static WebView map;
    public TextView header;
    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.details);

}
    public void setInfo(String mystring){
        header = (TextView) findViewById(R.id.text01);
        header.setText(mystring);
        //Toast.makeText(this, map, Toast.LENGTH_LONG).show();
        //return;
    }
</code></pre>

<p>Ye, i keep getting force close on my android phone. The App i meant to change the header text to text that ive tapped on the listview. But when i click a item it pop up a window with FC.</p>

<p>ive try to comment away the: </p>

<pre><code>header = (TextView) findViewById(R.id.text01);
        header.setText(mystring);
</code></pre>

<p>and it worked without a FC however the headertext is stil null.</p>

<p>Thank you!
Your Friend!</p>
