Shoucang3
package com.baidu.text1;
import java.util.ArrayList;
import com.baidu.adapter.MyAdapter;
import com.bwie.vo.List;
import com.lidroid.xutils.DbUtils;
import com.lidroid.xutils.exception.DbException;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.ListView;
public class ShowActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show);
ListView listView = (ListView) findViewById(R.id.lv_s);
DbUtils dbUtils = DbUtils.create(ShowActivity.this, "1407a");
try {
dbUtils.createTableIfNotExist(List.class);
java.util.ArrayList<List> list = (ArrayList<List>) dbUtils.findAll(List.class);
listView.setAdapter(new MyAdapter(ShowActivity.this, list));
} catch (DbException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_show, menu);
return true;
}
}