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)
我想问如何改正,错误的原因是什么
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。