怎么点击ListView中的项目跳转到另一个activity
比如说我想写一个这样的程序
MobileHoll.java
package com.MobileHoll;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
public class MobileHoll extends Activity {
/** Called when the activity is first created. */
String[] menues;
int[] pics;
ListView lv;
ImageView iv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayAdapter<String > mAdapter;
lv=(ListView)findViewById(R.id.ListView01);
iv=(ImageView)findViewById(R.id.ImageView01);
menues=new String[]{"话费余额查询","积分查询及兑换","套餐查询"};
pics=new int[]{R.drawable.pic1,R.drawable.pic2,R.drawable.pic3};
mAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,menues);
lv.setAdapter(mAdapter);
iv.setImageResource(pics[0]);
lv.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
}});
}
}
怎么在onItemClick写,使得当点击项目"话费余额查询","积分查询及兑换","套餐查询"时跳转到相应的界面(我是新手,求指教)谢谢
[解决办法]
在public void onItemClick方法里面写跳转Intent就行了呗,,,