public class listview extends ListActivity {
 String sign,name,latitude,longitude,description;
 int signValue;
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.listview);
  Intent searchTolistview = getIntent();
  signValue = searchTolistview.getIntExtra("sign", signValue);  dataBaseHelper hereami_helper = new dataBaseHelper(listview.this, "hereamiTest");
  SQLiteDatabase hereami_sqlite = hereami_helper.getReadableDatabase();
  Cursor cursor = hereami_sqlite.query("hereami_table", new String[] {"sign","name" },
    "sign=?" , new String[]{""+signValue}, null, null, null);
  ArrayList<HashMap<String, String>> hereami_list = new ArrayList<HashMap<String, String>>();
 
  while (cursor.moveToNext()) {
   name = cursor.getString(cursor.getColumnIndex("name"));
   HashMap<String, String> map = new HashMap<String, String>();
   map.put("name", name);
   hereami_list.add(map);
  }
  SimpleAdapter hereami_listAdapter = new SimpleAdapter(this, hereami_list,
    R.layout.listview_hashmap, new String[] { "name" },
    new int[] {R.id.name });
  setListAdapter(hereami_listAdapter);
 }protected void onListItemClick(ListView l, View v, int position, long id) {
  super.onListItemClick(l, v, position, id);
else if (name.equals("jiansheyinhang")) {
   Toast.makeText(listview.this, name+" is checked",
     Toast.LENGTH_LONG).show();
   /*Intent listviewTodescription = new Intent();
   listviewTodescription.putExtra("selected_name", "name");
   listviewTodescription.setClass(listview.this, description.class);
   listview.this.startActivity(listviewTodescription);*/咱们主要来看最下边的代码(/*...*/中的) 如果点击的名字是jiansheyinhang的话 先输出个Toast 然后定义Intent 把所点击的name值当作放在selected_name中 传递过去 下边看看description.javapublic class description extends Activity{ String selected_name;
 protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(R.layout.description);
  
  Intent listviewTodescription = new Intent();
  selected_name = listviewTodescription.getStringExtra("selected_name");
  System.out.println(selected_name);
 }}就是简单的取值 和输出 但是在输出的时候总是说我空指针异常 在输出语句 难道我的值没有取出来?!还是怎么的?问题补充:我写了 在开头了 怎么没了 
这个程序主要是这样的意思 在listview.java中是查询数据库 把复合条件的放在hashmap中 再把hashmap放在list中 用户点击hashmap实现页面跳转到description.java进行进一步查询 其中显示的内容只有name,在description中我想按照所点击的名字查询对应name的数据库中description内容 那都是后话了 现在我把name 放在selected_name中 都传不过去PS:我把intent 中传的name的“”去掉了 因为name本身就是String类型的 在description.java中的System.out.println中的selected_name变成了"selected_name" 他直接输出了selected_name这几个字 如果不加双引号 就空指针异常 那我的name到底传过来没有啊?!我输出了selected_name.length()也是空指针异常 看来没传过来 到底什么问题?!