Good time!

I have Activity for ListView, that are wrapped on whole view:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<ListView
   android:id="@android:id/list"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:drawSelectorOnTop="false"
/>
</LinearLayout>

I'm adding items to this ListView from string-array:

<string-array name="list_banks_ua">
    <item>Приватбанк</item>
    <item>Приватбанк1</item>
    <item>Приватбанк2</item>
    <item>Приватбанк3</item>
    <item>Приватбанк4</item>
    <item>Приватбанк5</item>
    <item>Приватбанк6</item>
</string-array>

by this code:

public class MainActivity extends ListActivity
{
    /** Called when the activity is first created. */
        public String[] listBanksUA;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        listBanksUA =
getResources().getStringArray(R.array.list_banks_ua);
        setListAdapter(new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,listBanksUA));
    }

}

Yeh, that's greate and it works as I want.

But I want to new activity appears after click in item in this
ListView, What do I for this? Next code:

@Override
protected void onListItemClick(ListView l, View v, int position, long
id)
{
 Intent intent = new
Intent(MainActivity.this,ListRegionActivity.class);
startActivity(intent);
}

So, after click on item in ListView I'm getting the message -
"Application %app has stopped unexpectedly.Please, try again".
Of course, new activity is added to manifest.

Help mem please, someone, becouse of I'm in stub...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to