Another just learning problem.....Loaded and ran basic HelloAndroid
program ok.
Now trying developers Tutorial on ListView.   Orignially followed
tutorial as given. Then tried many changes to get it to run properly.
Program will only load standard android AVD view.  Ignores my attempt
at a list view even though says it finished loading and installing
successfully.

the console and xml for manifest and package are:

manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="com.example.hlv"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="12" />



        <listactivity android:name=".HelloListViewActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action
android:name="android.intent.action.LIST_ITEM" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </listactivity>
</manifest>


package

package com.example.hlv;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;


public class HelloLstV2Activity extends ListActivity {
    /** Called when the activity is first created. */
    @Override
public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);


                String[] countries =
getResources().getStringArray(R.array.countries_array);
                setListAdapter(new ArrayAdapter<String>(this,
R.layout.list_item, countries));

                ListView lv = getListView();
                lv.setTextFilterEnabled(true);
                lv.setOnItemClickListener(new OnItemClickListener() {

public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
                        // When clicked, show a toast with the TextView text
                        Toast.makeText(getApplicationContext(), ((TextView)
view).getText(),
                                        Toast.LENGTH_SHORT).show();
                        }
                });
        }



        private void setListAdapter(ArrayAdapter<String> arrayAdapter) {
                // TODO Auto-generated method stub

        }
}

console

[2011-09-15 09:38:50 - HelloListView] ------------------------------
[2011-09-15 09:38:50 - HelloListView] Android Launch!
[2011-09-15 09:38:50 - HelloListView] adb is running normally.
[2011-09-15 09:38:50 - HelloListView] No Launcher activity found!
[2011-09-15 09:38:50 - HelloListView] The launch will only sync the
application package on the device!
[2011-09-15 09:38:50 - HelloListView] Performing sync
[2011-09-15 09:38:50 - HelloListView] Automatic Target Mode: launching
new emulator with compatible AVD 'MyAVDtest1'
[2011-09-15 09:38:50 - HelloListView] Launching a new emulator with
Virtual Device 'MyAVDtest1'
[2011-09-15 09:39:01 - HelloListView] New emulator found:
emulator-5554
[2011-09-15 09:39:01 - HelloListView] Waiting for HOME
('android.process.acore') to be launched...
[2011-09-15 09:40:19 - HelloListView] HOME is up on device
'emulator-5554'
[2011-09-15 09:40:19 - HelloListView] Uploading HelloListView.apk onto
device 'emulator-5554'
[2011-09-15 09:40:19 - HelloListView] Installing HelloListView.apk...
[2011-09-15 09:41:20 - HelloListView] Success!
[2011-09-15 09:41:20 - HelloListView] \HelloListView\bin
\HelloListView.apk installed on device
[2011-09-15 09:41:20 - HelloListView] Done!

-- 
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