import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity {
private ImageView zy, ZyImge;
private TextView ZyLine, ZyLeade, ZyAb;
private String url;
private SimpleAdapter adapter;
private DBUtil dbUtil;
protected static final int MSG_OK = 0;
private ListView lv = null;
//private MyAdapter myAdapter = null;
private List<Card> list = new ArrayList<Card>();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.adapter_item);
zy = (ImageView) findViewById(R.id.zhengyou_list_img);
ZyImge = (ImageView) findViewById(R.id.zhengyou_list_luxian);
ZyLeade = (TextView) findViewById(R.id.zhengyou_list_name);
ZyLine = (TextView) findViewById(R.id.zhengyou_list_title);
ZyAb = (TextView) findViewById(R.id.zhengyou_list_time);
final String ZyLines = getIntent().getExtras().getString("ZyLines");
final String ZyImage = getIntent().getExtras().getString("ZyImage");
final String ZyLeader = getIntent().getExtras().getString("ZyLeader");
final String ZyAbs = getIntent().getExtras().getString("ZyAbs");
ZyLine.setText(ZyLines);
ZyLeade.setText(ZyLeader);
ZyAb.setText(ZyAbs);
}
}
logcat中错误提示:
Caused by: java.lang.NullPointerException
07-24 09:00:34.209: E/AndroidRuntime(9339): at com.example.lianwang.MainActivity.onCreate(MainActivity.java:55)
07-24 09:00:34.209: E/AndroidRuntime(9339): at android.app.Activity.performCreate(Activity.java:5122)
07-24 09:00:34.209: E/AndroidRuntime(9339): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
07-24 09:00:34.209: E/AndroidRuntime(9339): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
我想问如何改正,错误的原因是什么