开发者

Android List view selection to open activity [closed]

开发者 https://www.devze.com 2023-03-22 13:09 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Heres my code

package com.momentum.waldo;

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;

public class listV extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setListAdapter( new ArrayAdapter<String>(this, R.layout.levels, Levels));

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

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                    long arg3) {
                // TODO Auto-generated method stub

            }

        });
    }





    static final String[] Levels = new String [] {
        "Beach", "Carnaval", "Foot ball Stadium",开发者_JAVA技巧 "Santas Work Shop", "Mall"
    };
}


PLEASE do research before you post questions. A lot of basic information is available on the Android reference. Read here first please: http://developer.android.com/reference/android/app/Activity.html#StartingActivities

0

精彩评论

暂无评论...
验证码 换一张
取 消