【Android】求助。AndroidStudio空指针异常:listview与adapter的使用报空 java.lang.NullPointerException

最近在做关于Android朋友圈相关功能用到listview,现在卡在以下这个问题,急需各位大佬帮帮小弟。
图片说明
以下是代码
图片说明

图片说明

图片说明

图片说明

谢谢!!

1个回答

getApplicationContext==null
你换成LayoutInflater。from(parent。getContent())就可以啦

weixin_41236653
Sambolemon 说这句出错了。 holder = (ViewHolder) convertView.getTag();
大约一年之前 回复
weixin_41236653
Sambolemon 改完之后又报: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.view.View.getTag()' on a null object reference
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ListView中遇到的空指针异常

以下代码段,异常在最下面: ``` package com.sweetstar86.myapplicationlistview; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import java.util.Vector; public class MainActivity6 extends AppCompatActivity { private ListView listView; private Vector<News> news = new Vector<>(); private MyAdapter myAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main6); listView = (ListView) findViewById(R.id.listView5); initData(); myAdapter = new MyAdapter(); listView.setAdapter(myAdapter); } private int index = 1; /** * Init Data */ private void initData() { for (int i = 0; i < 10; i++) { News n = new News(); n.title = "title--" + index; n.content = "content--" + index; index++; news.add(n); } } class MyAdapter extends BaseAdapter { @Override public int getCount() { return news.size(); } @Override public Object getItem(int position) { return news.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder vh; if(convertView==null){ convertView = getLayoutInflater().inflate(R.layout.list_item_6,null); vh = new ViewHolder(); vh.tv_title = (TextView) convertView.findViewById(R.id.textView_title); vh.tv_content = (TextView) convertView.findViewById(R.id.textView_content); convertView.setTag(vh); }else{ vh = (ViewHolder) convertView.getTag(); } News n = news.get(position); vh.tv_title.setText(n.title); vh.tv_content.setText(n.content); return convertView; } class ViewHolder { TextView tv_title; TextView tv_content; } } } ``` 异常: java.lang.NullPointerException at com.sweetstar86.myapplicationlistview.MainActivity6$MyAdapter.getView(MainActivity6.java:77) at android.widget.AbsListView.obtainView(AbsListView.java:2622) at android.widget.ListView.makeAndAddView(ListView.java:1838) at android.widget.ListView.fillDown(ListView.java:681) at android.widget.ListView.fillFromTop(ListView.java:742) at android.widget.ListView.layoutChildren(ListView.java:1659) at android.widget.AbsListView.onLayout(AbsListView.java:2440) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1021) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.widget.FrameLayout.onLayout(FrameLayout.java:448) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:435) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.widget.FrameLayout.onLayout(FrameLayout.java:448) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527) at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.widget.FrameLayout.onLayout(FrameLayout.java:448) at android.view.View.layout(View.java:14615) at android.view.ViewGroup.layout(ViewGroup.java:4491) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2191) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2005) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1218) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4999) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791) at android.view.Choreographer.doCallbacks(Choreographer.java:591) at android.view.Choreographer.doFrame(Choreographer.java:561) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5308) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at dalvik.system.NativeStart.main(Native Method) 本人安卓新人,跟着教程学的,实在找不出来原因...

android listview 报错 空指针

这问题 困扰了我3天了 不知道为什么 求大神指点 上代码 这是onCreate里面的 // 商品 listview lv_friend=(ListView) findViewById(R.id.LV_store); adapter=new Myadapter(this, getdatas()); System.out.println("adapter+++++++++++"+adapter); lv_friend.setAdapter(adapter); } private List<GetDataType> getdatas() { List<GetDataType> list=new ArrayList<GetDataType>(); GetDataType data1=new GetDataType(); data1.setIv_portrait(R.drawable.ic_launcher); data1.setName("杨幂"); data1.setSignature("喜欢我就来找我啊"); list.add(data1); GetDataType data2=new GetDataType(); data2.setIv_portrait(R.drawable.ic_launcher); data2.setName("范冰冰"); data2.setSignature("我在这里等你哦"); list.add(data2); GetDataType data3=new GetDataType(); data3.setIv_portrait(R.drawable.ic_launcher); data3.setName("唐嫣"); data3.setSignature("来追我呀,呵呵"); list.add(data3); GetDataType data4=new GetDataType(); data4.setIv_portrait(R.drawable.ic_launcher); data4.setName("李小璐"); data4.setSignature("386562,加我好友呀"); list.add(data4); GetDataType data5=new GetDataType(); data5.setIv_portrait(R.drawable.ic_launcher); data5.setName("柳岩"); data5.setSignature("帅哥,过来一下"); list.add(data5); return list; } 这是Myadapter package com.android.workapp; import java.util.List; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; public class Myadapter extends BaseAdapter{ private List<GetDataType> mData; private Context mcontext; private int mid; public Myadapter(Context context,List data){ this.mcontext=context; this.mData=data; } //获取列表列的数量 @Override public int getCount() { return mData.size(); } //根据postion获取item的数据 @Override public Object getItem(int position) { return mData.get(position); } //获取position对应的id @Override public long getItemId(int position) { return position; } //创建item的视图 @Override public View getView(int position, View convertView, ViewGroup parent) { View view=View.inflate(mcontext, R.layout.saver_tickey_store_item, null); //获取item对应的数据对象 GetDataType getdata=mData.get(position); //初始化view ImageView iv_portrait= (ImageView) view.findViewById(R.id.IV_portrait); TextView txt_name=(TextView) view.findViewById(R.id.txt_name); TextView signature=(TextView) view.findViewById(R.id.signature); //邦定数据到view iv_portrait.setImageResource(getdata.getIv_portrait()); txt_name.setText(getdata.getName()); signature.setText(getdata.getSignature()); return view; } } GetDataType package com.android.workapp; public class GetDataType { private int iv_portrait; private String name; private String signature; public int getIv_portrait() { return iv_portrait; } public void setIv_portrait(int iv_portrait) { this.iv_portrait = iv_portrait; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSignature() { return signature; } public void setSignature(String signature) { this.signature = signature; } } ![图片说明](https://img-ask.csdn.net/upload/201601/25/1453724110_137295.png)

android adapter 提示空指针异常

``` public class ContactInfoParser extends Activity { ListView mListView; List<String> contactList = new ArrayList<String>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mListView = (ListView) findViewById(R.id.list_contact); ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, contactList); mListView.setAdapter(adapter); readContacts(); } private void readContacts() { Cursor cursor = null; try{ cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); while (cursor.moveToNext()) { String displayname = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME)); String diplaynumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); contactList.add(displayname + "\n" + diplaynumber); } }catch (Exception e){ e.printStackTrace(); }finally { if (cursor != null) { cursor.close(); } } } } ``` 上面这段代码从其他activity跳转过来,执行到mListView.setAdapter(adapter);这句话的时候,提示一直报错空指针异常。 报错代码如下: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.liujing.shanzhaisafe/com.liujing.shanzhaisage.fangdaomokuai.dialog.ContactInfoParser}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at com.liujing.shanzhaisage.fangdaomokuai.dialog.ContactInfoParser.onCreate(ContactInfoParser.java:24)

Android ListView 自定义Adapter 滑动时报空指针异常

问题背景:在制作一个即时聊天的APP中,聊天界面聊天消息的显示我使用了ListView,并且使用了自定义的Adapter,获取到聊天记录之后ListView可以正常显示,但是一旦滑动就会报空指针异常。我查看了很多博客,都没有提到与这个相关或者类似的错误已经被这个错误逼疯了,希望有了解的大神能够给予指点。 具体相关代码如下: 自定义的Adapter: ``` public class ChatMessageAdapter extends BaseAdapter { private LayoutInflater layoutInflater; private List<MessageShow> messageShowList; public ChatMessageAdapter(Context context, List<MessageShow> messageShowList){ layoutInflater = LayoutInflater.from(context); this.messageShowList = messageShowList; } @Override public int getCount() { return messageShowList.size(); } @Override public Object getItem(int position) { return messageShowList.get(position); } @Override public int getItemViewType(int position) { if(messageShowList.get(position).getMessageType()==0) return 0; else return 1; } //Item类型的总数 @Override public int getViewTypeCount() { return 2; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { MessageShow messageShow = messageShowList.get(position); ViewHolder viewHolder = null; if(convertView == null){ if(messageShow.getMessageType() == 0){ convertView = layoutInflater.inflate(R.layout.from_message_item,null); viewHolder = new ViewHolder(); // viewHolder.imageView = (ImageView) convertView.findViewById(R.id.from_user_icons); viewHolder.time = (TextView) convertView.findViewById(R.id.from_time); viewHolder.message = (TextView) convertView.findViewById(R.id.from_message); } else{ convertView = layoutInflater.inflate(R.layout.to_message_item,null); viewHolder = new ViewHolder(); // viewHolder.imageView = (ImageView) convertView.findViewById(R.id.to_user_icons); viewHolder.time = (TextView) convertView.findViewById(R.id.to_time); viewHolder.message = (TextView) convertView.findViewById(R.id.to_message); } } else { viewHolder = (ViewHolder) convertView.getTag(); } System.out.println("我到了这里"+position); System.out.println("我添加了适配器: "+messageShow.getContents()); // viewHolder.imageView.setImageResource(R.drawable.photo); //报空指针异常的是这里 viewHolder.message.setText(messageShow.getContents()); viewHolder.time.setText(messageShow.getTime()); return convertView; } private final class ViewHolder{ // ImageView imageView; TextView time; TextView message; } ``` ,ChatActivity代码如下: ``` private List<MessageShow> showMessageList; private ChatMessageAdapter chatMessageAdapter; 、、、省略无关 //初始化数据 private void initData(){ showMessageList = new ArrayList<MessageShow>(); chatMessageAdapter = new ChatMessageAdapter(this,showMessageList); listView.setAdapter(chatMessageAdapter); getMessageRecord(); chatMessageAdapter.notifyDataSetChanged(); } ``` 其中获取聊天记录我已经在控制台打印出来检查过了,没有错误,而ListView能够显示说明Apapter也不会有基本的错误,但是还是报空指针。我对错误的猜测如下: 虽然给的数据集可能有几十项,但是Adapter加载的时候只加载了当前显示的几项,后面的没加载,等我我滑动之后去加载的时候没加载到数据就报空指针了。但是这不太科学啊,我看了好多博客发现都没有专门说到这点,仔细检查代码也不知道应该怎么改,求指教。报错信息如下: ``` I/System.out: 我到了这里1 I/System.out: 我添加了适配器: 图片这些不能点击? I/System.out: 我到了这里2 I/System.out: 我添加了适配器: 还没做那些功能呢233 I/System.out: 我到了这里3 I/System.out: 我添加了适配器: 图片和表情 I/System.out: 我到了这里4 I/System.out: 我添加了适配器: 额 I/System.out: 我到了这里5 I/System.out: 我添加了适配器: 准备等APP开发完之后再说 I/System.out: 我到了这里6 I/System.out: 我添加了适配器: 真的挺费脑的 I/System.out: 我到了这里7 I/System.out: 我添加了适配器: 嗯 加油 E/InputEventReceiver: Exception dispatching input event. D/AndroidRuntime: Shutting down VM W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa6160908) E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NullPointerException at cn.justwithme.withme.Adapaer.ChatMessageAdapter$override.getView(ChatMessageAdapter.java:84) at cn.justwithme.withme.Adapaer.ChatMessageAdapter$override.access$dispatch(ChatMessageAdapter.java) at cn.justwithme.withme.Adapaer.ChatMessageAdapter.getView(ChatMessageAdapter.java:0) ``` 本来有十几项的,第一页只有7项,我在Adapter的输出就只出输出了7项。 ![图片说明](https://img-ask.csdn.net/upload/201702/19/1487495789_116858.png) ![图片说明](https://img-ask.csdn.net/upload/201702/19/1487495801_419892.png)

listView.setChoiceMode()出现空指针异常

使用一个AppCompatActivity来托管一个ListFragment。在ListFragment实现了上下文 菜单,但是在OncreateView中使用listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL)时出现空指针异常。 这是代码 ![图片说明](https://img-ask.csdn.net/upload/201511/07/1446883807_63178.png) 这是异常: ![图片说明](https://img-ask.csdn.net/upload/201511/07/1446883861_853132.png)

在viewpager和fragment中嵌套listview,出现setAdapter空指针情况。

在viewpager和fragment中嵌套listview,出现setAdapter空指针情况。 为了实现滑动切换界面,我写了三个fragment,在一个fragment中加入了一个listview,怎么启动都是空指针。 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at com.example.tabhost_02.Fragment_Device.onActivityCreated(Fragment_Device.java:33) at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2619) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:904) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManagerImpl.java:1696) at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:299) at androidx.fragment.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:235) at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244) at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092) at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514) at android.widget.LinearLayout.measureVertical(LinearLayout.java:806) at android.widget.LinearLayout.onMeasure(LinearLayout.java:685) at android.view.View.measure(View.java:22002) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at androidx.appcompat.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:403) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514) at android.widget.LinearLayout.measureVertical(LinearLayout.java:806) at android.widget.LinearLayout.onMeasure(LinearLayout.java:685) at android.view.View.measure(View.java:22002) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:721) at android.view.View.measure(View.java:22002) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2410) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1498) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1751) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:658) <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/textView5" android:layout_width="358dp" android:layout_height="wrap_content" android:text="状态详情" android:textColor="#000000" android:textSize="20sp" android:textStyle="bold" /> <TextView android:id="@+id/textView2" android:layout_width="match_parent" android:layout_height="176dp" android:text="TextView" /> <TextView android:id="@+id/textView3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="部件信息" android:textColor="#000000" android:textSize="20sp" android:textStyle="bold" /> <TextView android:id="@+id/textView6" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="温度传感器" android:textColor="#2196F3" android:textSize="18sp" android:textStyle="bold" /> <ListView android:id="@+id/lv" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> public class Fragment_Device extends Fragment { private List<Info> infos = new ArrayList<>(); private ListView device_info=null; public Fragment_Device(){ } public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.activity_device, container, false); initInfo(); return view; } public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); initInfo(); } private void initInfo() { Info dev_1 = new Info("室内环境监控", "20摄氏度", "100小时", "2019-05-01 09:00:00"); infos.add(dev_1); Info dev_2 = new Info("室内环境监控", "25摄氏度", "100小时", "2019-05-01 09:08:00"); infos.add(dev_2); Info dev_3 = new Info("室内环境监控", "23摄氏度", "100小时", "2019-05-01 10:00:00"); infos.add(dev_3); Info dev_4 = new Info("室内环境监控", "28摄氏度", "100小时", "2019-05-01 10:30:00"); infos.add(dev_4); InfoAdapter infoAdapter = new InfoAdapter(infos,getContext()); View view = LayoutInflater.from(getContext()).inflate(R.layout.list_item,null); infos=view.findViewById(R.id.lv); device_info = view.findViewById(R.id.lv); device_info.setAdapter(infoAdapter); } }

安卓listview item单击事件跳转空指针问题

两个activity源码, mainactivity: package com.example.newsclient; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.example.gxfi.entity.News; import com.example.gxfi.service.GetXmlAndParse; import android.R.string; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; public class MainActivity extends Activity { private List listNews; private ListView list; Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub switch (msg.what) { case GetXmlAndParse.PARSESUCCWSS: listNews = (List) msg.obj; initData(); break; } super.handleMessage(msg); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); list = (ListView) findViewById(R.id.list); GetXmlAndParse getXmlAndParse = new GetXmlAndParse(mHandler); getXmlAndParse.getXml(); list.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method stub switch (parent.getId()) { case R.id.list: expressItemClick(position);//position 代表你点的哪一个 break; } } private void expressItemClick(int position) { // TODO Auto-generated method stub Intent intent = new Intent(MainActivity.this,NewsActivity.class); Map<String, String> item = (Map<String, String>) list.getAdapter().getItem(position); String essay = item.get("description"); //添加到intent域中 intent.putExtra("description",essay ); startActivity(intent); finish(); }}); } /** * 将解析后的xml填充到ListView */ protected void initData() { // TODO Auto-generated method stub List items = new ArrayList(); for (News news : (List<News>)listNews) { Map item = new HashMap(); item.put("title", news.getTitle()); item.put("description", news.getDescription()); items.add(item); } SimpleAdapter adapter = new SimpleAdapter(this, items, R.layout.news_view, new String[] { "title" }, new int[] { R.id.textView1 }); list.setAdapter(adapter); } } newsactivity: package com.example.newsclient; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; public class NewsActivity extends Activity { private TextView myTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent = getIntent(); String value = intent.getStringExtra("description"); myTextView = (TextView) findViewById(R.id.textview2); // myTextView.setText(value); } } 错误: ![图片说明](https://img-ask.csdn.net/upload/201606/19/1466349934_182376.png)

android adapter提示空指针异常情况

主要代码如下: package com.example.mydreamhero.ActivityManage; import android.app.Activity; import android.app.ActivityManager; import android.content.Context; import android.os.Bundle; import android.os.Debug; import android.widget.ListView; import com.example.mydreamhero.R; import java.util.ArrayList; import java.util.List; /** * Created by 刘 on 2017/3/5. */ public class AMProcessActivity extends Activity { private ListView listView; private List<AMProcessInfo> mAmprocessInfo = null; private ActivityManager manager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.am_main); listView = (ListView) findViewById(R.id.listview_am_process); manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); //提示下面这一行出错 listView.setAdapter(new AMProcessAdapter(this, getRunningprocess())); } private List<AMProcessInfo> getRunningprocess() { mAmprocessInfo = new ArrayList<AMProcessInfo>(); List<ActivityManager.RunningAppProcessInfo> appprocessInfo = manager.getRunningAppProcesses(); for (int i = 0; i < appprocessInfo.size(); i++) { ActivityManager.RunningAppProcessInfo info = appprocessInfo.get(i); int pid = info.pid; int uid = info.uid; String processName = info.processName; int[] memorypid = new int[]{pid}; Debug.MemoryInfo memoryInfo[] = manager.getProcessMemoryInfo(memorypid); int memorySize = memoryInfo[0].getTotalPss(); AMProcessInfo amProcessInfo = new AMProcessInfo(); amProcessInfo.setPid(""+pid); amProcessInfo.setUid(""+uid); amProcessInfo.setMemorySize(memorySize+"KB"); amProcessInfo.setProcessName(processName); mAmprocessInfo.add(amProcessInfo); } return mAmprocessInfo; } }** 出错一次如下: 03/05 23:17:17: Launching app $ adb push F:\androidforGoogle\MyDreamHero\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.example.mydreamhero $ adb shell pm install -r "/data/local/tmp/com.example.mydreamhero" pkg: /data/local/tmp/com.example.mydreamhero Success $ adb shell am start -n "com.example.mydreamhero/com.example.mydreamhero.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Waiting for process to come online Connected to process 3275 on device genymotion-genymotion_vbox86p_6_0_160825_141918-192.168.196.101:5555 I/art: Background partial concurrent mark sweep GC freed 1613(300KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 1587KB/2MB, paused 101us total 183.475ms D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.mydreamhero, PID: 3275 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mydreamhero/com.example.mydreamhero.ActivityManage.AMProcessActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference at com.example.mydreamhero.ActivityManage.AMProcessActivity.onCreate(AMProcessActivity.java:29) at android.app.Activity.performCreate(Activity.java:6237) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  我查了好多次都没有找到原因,求大神来不吝解答一下

android adapter空指针异常

``` public class MainActivity extends AppCompatActivity { DatabaseHelper databaseHelper; private static Toolbar mToolbar; private static TextView mMaintitle,mMaincontent,mMaintime; public static EditText dlx_Input1,dlx_Input2; public static String datetime; public static View mLine; MyAdapter myAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findName(); setSupportActionBar(mToolbar); databaseHelper = new DatabaseHelper(this, databaseHelper.DATABASE_NAME, null, databaseHelper.DATABASE_VERSION); //myAdapter.getData2(); myAdapter = new MyAdapter(this); myAdapter.lv = (ListView)findViewById(R.id.lv); myAdapter.data = myAdapter.getData(); MyAdapter adapter = new MyAdapter(this); myAdapter.lv.setAdapter(adapter); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_add: showDialog_Layout(MainActivity.this); } return super.onOptionsItemSelected(item); } public void findName() { mToolbar = (Toolbar) findViewById(R.id.toolbar); mMaintitle = (TextView)findViewById(R.id.dlx_maintitle); mMaincontent = (TextView)findViewById(R.id.dlx_maincontent); mMaintime = (TextView)findViewById(R.id.dlx_maintime); mLine = (View)findViewById(R.id.dlx_line); } private void showDialog_Layout(Context context) { dlx_Input1 = (EditText)findViewById(R.id.dlx_Input1); dlx_Input2 = (EditText)findViewById(R.id.dlx_Input2); final AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(false); builder.setTitle(R.string.dlx_add); builder.setPositiveButton("CANCEL", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { setTitle(""); } }); builder.setNegativeButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { SQLiteDatabase db = databaseHelper.getWritableDatabase(); ContentValues values = new ContentValues(); SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); datetime = s.format(new java.util.Date()); values.put("title", String.valueOf(dlx_Input1.getText())); values.put("content", String.valueOf(dlx_Input2.getText())); values.put("time", datetime); db.insert(databaseHelper.TABLE_NAME, null, values); myAdapter.getData(); } }); builder.show(); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); menu.findItem(R.id.action_add).setChecked(true); return super.onCreateOptionsMenu(menu); } } public class MyAdapter extends BaseAdapter { public static ListView lv; public static List<Map<String, Object>> data; public LayoutInflater mInflater = null; MainActivity mainActivity; DatabaseHelper databaseHelper; public MyAdapter(Context context) { this.mInflater = LayoutInflater.from(context); } public List<Map<String, Object>> getData() { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); Map<String, Object> map; for(int i=0;i<10;i++) { map = new HashMap<String, Object>(); map.put("title",String.valueOf(mainActivity.dlx_Input1.getText())); map.put("content", String.valueOf(mainActivity.dlx_Input2.getText())); map.put("time",mainActivity.datetime); list.add(map); } return list; } static class ViewHolder { public TextView title; public TextView content; public TextView time; public View line; } public int getCount() { //How many items are in the data set represented by this Adapter. //在此适配器中所代表的数据集中的条目数 return data.size(); } public Object getItem(int position) { // Get the data item associated with the specified position in the data set. //获取数据集中与指定索引对应的数据项 return position; } public long getItemId(int position) { //Get the row id associated with the specified position in the list. //获取在列表中与指定索引对应的行id return position; } //Get a View that displays the data at the specified position in the data set. //获取一个在数据集中指定索引的视图来显示数据 public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; //如果缓存convertView为空,则需要创建View if(convertView == null) { holder = new ViewHolder(); //根据自定义的Item布局加载布局 convertView = mInflater.inflate(R.layout.commentlayout, null); holder.title = (TextView)convertView.findViewById(R.id.dlx_maintitle); holder.content = (TextView)convertView.findViewById(R.id.dlx_maincontent); holder.time = (TextView)convertView.findViewById(R.id.dlx_maintime); holder.line = (View)convertView.findViewById(R.id.dlx_line); //将设置好的布局保存到缓存中,并将其设置在Tag里,以便后面方便取出Tag convertView.setTag(holder); }else { holder = (ViewHolder)convertView.getTag(); } holder.title.setText((String)data.get(position).get("title")); holder.content.setText((String)data.get(position).get("content")); holder.time.setText((String)data.get(position).get("time")); holder.line.setBackgroundColor(mainActivity.getResources().getColor(R.color.colorPrimaryDark)); return convertView; } ``` 在map.put("title",String.valueOf(mainActivity.dlx_Input1.getText()));和myAdapter.data = myAdapter.getData();报空指针异常 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference,求大神指点!!!

写了个ListView,打开就崩溃

用的Android Studio。Activity自动在manifests里注册了。 将该activity设置为打开加载页面时,打开就直接闪退。 错误信息一闪就没了... Java代码: package com.demo.listview; import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; public class MyLIST extends Activity { private String[] list=getResources().getStringArray(R.array.lesson_name_list_cn); private ListView lv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); lv=(ListView)findViewById(R.id.lv); lv.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1,list)); } } XML: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context="com.demo.listview"> <!--添加一个ListView控件--> <ListView android:id="@+id/lv" android:layout_width="match_parent" android:layout_height="match_parent"> </ListView> </LinearLayout>

android listview 删除之后怎么刷新 listview

这个是TitleAdapter package com.example.ming.myapplication; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.net.MalformedURLException; import java.net.URL; import java.util.List; public class TitleAdapter extends BaseAdapter { Context context; List<Article> postlist2; String id2; String id=""; int ii=0; public TitleAdapter(Context context, List<Article> postlist) { this.context = context; this.postlist2 = postlist; } @Override public int getCount() { return postlist2.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { convertView = LayoutInflater.from(context).inflate(R.layout.activity_article, null); Object obj = convertView.getTag(); ii=position; ViewHolder holder;//实现缓存 高效加载数据 //如果为空 if (obj == null) { holder = new ViewHolder(convertView); convertView.setTag(holder); } else { //緩存 通過viewholder存儲 holder = (ViewHolder) obj; } Article posit = postlist2.get(position); holder.tv_tltleid.setText(posit.getWid() + ""); holder.tv_tltlecontent.setText(posit.getTitle() + ""); return convertView; } public class ViewHolder { public View lv_title; public TextView tv_tltleid; public TextView tv_tltlecontent; public Button btn_neirong; public Button btn_delete; public ViewHolder(View rootView) { this.lv_title = rootView; this.tv_tltleid = (TextView) rootView.findViewById(R.id.tv_tltleid); this.tv_tltlecontent = (TextView) rootView.findViewById(R.id.tv_tltlecontent); this.btn_neirong=(Button)rootView.findViewById(R.id.btn_neirong); btn_neirong.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent2 = new Intent(context, ContentActivity.class); String id2=tv_tltleid.getText().toString(); Log.i("aaa",id2); intent2.putExtra("wid",id2); context.startActivity(intent2); } }); this.btn_delete = (Button) rootView.findViewById(R.id.btn_delete); btn_delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String id = tv_tltleid.getText().toString(); Log.i("1111", id); Log.i("11112", id); String url = "http://192.168.43.124:8080/test1/LoginServlet?jsp=delete&wid=" + id; new LoginTask().execute(url); } }); } class LoginTask extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... params) { String par = params[0]; URL url = null; try { url = new URL(par); } catch (MalformedURLException e) { e.printStackTrace(); } String result = HttpUtil.doPost(url); return result; } //第四步 @Override protected void onPostExecute(String result) { super.onPostExecute(result); //保存数据 if (result.equals("1")) { Toast.makeText(context, "删除成功", Toast.LENGTH_SHORT).show(); return; } else { if (result.equals("-1")) { Toast.makeText(context, "删除失败", Toast.LENGTH_SHORT).show(); return; } } } } } } 这个是TitleActivity package com.example.ming.myapplication; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.Button; import android.widget.ListView; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import org.json.JSONArray; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; /** * Created by Ming on 2019/6/16. */ public class TitleActivity extends AppCompatActivity { private ListView listView; Article article; JSONArray jsonArray; ListView lv_title; Context context; Button button; String id2="used"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_title); Intent intent=getIntent(); id2=intent.getStringExtra("id2"); context = this; String url = "http://192.168.43.124:8080/test1/LoginServlet?jsp=titleck&id2="+id2; new LoginTask().execute(url); } class LoginTask extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... params) { String par = params[0]; URL url = null; try { url = new URL(par); } catch (MalformedURLException e) { e.printStackTrace(); } String result = HttpUtil.doPost(url); return result; } //第四步 @Override protected void onPostExecute(String result) { super.onPostExecute(result); final List<Article> list = new ArrayList<Article>(); Gson gson1 = new Gson(); final List<Article> list2 = gson1.fromJson(result, new TypeToken<List<Article>>() { }.getType()); for (Article person1 : list) { System.out.println(person1.toString()); } lv_title=(ListView)findViewById(R.id.lv_title); lv_title.setAdapter(new TitleAdapter(context,list2)); } } } 1.

安卓 锁屏/显示或者隐藏虚拟菜单导致侧拉菜单listview的适配报空指针异常

![页面显示](https://img-ask.csdn.net/upload/201603/23/1458698933_705574.png) ![问题出现的地方](https://img-ask.csdn.net/upload/201603/23/1458698965_625915.png) ![xml](https://img-ask.csdn.net/upload/201603/23/1458698998_995980.png) ![list内容](https://img-ask.csdn.net/upload/201603/23/1458699023_205122.png) ![getview](https://img-ask.csdn.net/upload/201603/23/1458699060_320209.png) 框架大致是v4的drawerlayout设置的侧拉菜单,侧拉菜单是listview,主体是头部导航条式的一堆button和下面对应的viewpager。 当进入APP后手机锁屏或者将手机下面的虚拟菜单隐藏或者显示就会报listview的适配里适配的布局属性设置报空指针。手机现在没法截图,我形容下。 getview里对适配的布局设置属性,比如说关联的布局有个textview为t,设置属性t.settext(list.get(posision).gettext()) 设置适配器传递的list就为空没有值了。 补充:直接切换到桌面或者打开其它app再切换回来不会报错,应该是前后台跑不会报错,屏幕显示大小改变和锁屏后打开就会报错...没头脑啊~~~

Android Studio中listview与viewpager之间的问题

如何在viewpager中添加listview同时listview的数据是通过网络接口API获取的

Android中重写SimpleAdapter类引用后报空指针异常

直接粘代码吧 - - 重写的SimpleAdapter类: ``` public class MySimpleAdapter extends BaseAdapter { private LayoutInflater mInflater; private ArrayList<HashMap<String, Object>> list; private int layoutID; private String flag[]; private int ItemIDs[]; public MySimpleAdapter(Context context, ArrayList<HashMap<String, Object>> list, int layoutID, String flag[], int ItemIDs[]) { this.mInflater = LayoutInflater.from(context); this.list = list; this.layoutID = layoutID; this.flag = flag; this.ItemIDs = ItemIDs; } @Override public int getCount() { // TODO Auto-generated method stub return list.size(); } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return 0; } @Override public long getItemId(int arg0) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { convertView = mInflater.inflate(layoutID, null); convertView = mInflater.inflate(layoutID, null); for (int i = 0; i < flag.length; i++) { if (convertView.findViewById(ItemIDs[i]) instanceof ImageView) { ImageView iv = (ImageView) convertView.findViewById(ItemIDs[i]); iv.setBackgroundResource((Integer) list.get(position).get( flag[i])); } else if (convertView.findViewById(ItemIDs[i]) instanceof TextView) { TextView tv = (TextView) convertView.findViewById(ItemIDs[i]); tv.setText((String) list.get(position).get(flag[i])); } } addListener(convertView); return convertView; } public void addListener(View convertView) { ((TextView)convertView.findViewById(R.id.order_mine_show_handle_confirm)).setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { new AlertDialog.Builder(OrderMineNonPaymentActivity.onp) .setTitle("自定义通用SimpleAdapter") .setMessage("按钮成功触发监听事件!") .show(); } }); } } ``` 引用的地方 OrderMineNonPaymentActivity: ``` /** * 动态生成订单列表 lipeng */ private void addNonPaymentList() { order_mine_show_non_payment_list_ll = (LinearLayout) findViewById(R.id.order_mine_show_non_payment_list_ll); nonPaymentList = (ListView) findViewById(R.id.order_mine_show_non_payment_list); nonPaymentList.setDivider(null); nonPaymentSimpleAdapter = new SimpleAdapter( OrderMineNonPaymentActivity.this, goodsList, R.layout.activity_order_non_payment_item, new String[] { "shopname", "bigimage", "goodname" }, new int[] { R.id.order_mine_show_shopname, R.id.order_mine_show_goods_img, R.id.order_mine_show_goods_name }); MySimpleAdapter nonPaymentSimpleAdapter = new MySimpleAdapter(this, goodsList, R.layout.activity_order_mine_non_payment, new String[] { "shopname", "bigimage", "goodname" }, new int[] { R.id.order_mine_show_shopname, R.id.order_mine_show_goods_img, R.id.order_mine_show_goods_name }); nonPaymentList.setAdapter(nonPaymentSimpleAdapter); } private class MyOnItemClickListener implements OnItemClickListener { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub } } ``` 异常报的空指针,找了半天也没找到为啥空指针了 ``` 06-17 22:55:32.845: E/AndroidRuntime(1463): FATAL EXCEPTION: main 06-17 22:55:32.845: E/AndroidRuntime(1463): Process: com.zb.stlala, PID: 1463 06-17 22:55:32.845: E/AndroidRuntime(1463): java.lang.NullPointerException 06-17 22:55:32.845: E/AndroidRuntime(1463): at com.zb.stlala.adapter.MySimpleAdapter.addListener(MySimpleAdapter.java:83) 06-17 22:55:32.845: E/AndroidRuntime(1463): at com.zb.stlala.adapter.MySimpleAdapter.getView(MySimpleAdapter.java:75) ```

求大神指导Android中重写SimpleAdapter类引getCount空指针异常,万分感谢

重写的BaseAdapter: ``` public class MyAdapter extends BaseAdapter { List<UserInfo> userInfos=new ArrayList<UserInfo>(); Context context; public MyAdapter(Context c,List<UserInfo> userInfos) { // TODO Auto-generated constructor stub this.context=c; this.userInfos=userInfos; } public void setcotext(List<UserInfo> userInfos){ this.userInfos=userInfos; } @Override public int getCount() { // TODO Auto-generated method stub return userInfos.size(); } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return userInfos.get(arg0); } @Override public long getItemId(int arg0) { // TODO Auto-generated method stub return userInfos.get(arg0).getId(); } @Override public View getView(int arg0, View arg1, ViewGroup arg2) { // TODO Auto-generated method stub if(arg1==null){ arg1=LayoutInflater.from(context).inflate(R.layout.book_item, null); } TextView _context=(TextView) arg1.findViewById(R.id.content); TextView _datetime=(TextView) arg1.findViewById(R.id.datetime); UserInfo u=userInfos.get(arg0); _context.setText(u.getContent()); _datetime.setText(u.getDatetime()); return arg1; } } ``` Activity的: ``` public class MainActivity extends Activity implements OnClickListener{ Button add; Button re; SQLiteDatabase db; ListView listView; MyAdapter adapter; List<UserInfo> liUse; protected void onRestart() { // TODO Auto-generated method stub super.onRestart(); shuaxin(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DbInit(); add=(Button) findViewById(R.id.add); listView=(ListView) findViewById(R.id.lv); registerForContextMenu(listView); adapter=new MyAdapter(this , liUse); listView.setAdapter(adapter); } public List<UserInfo> selectAll(){ List<UserInfo> ls=new ArrayList<UserInfo>(); Cursor cur=db.rawQuery(" select * from user ", null); while (cur.moveToNext()) { UserInfo u = new UserInfo(); u.setId(cur.getInt(cur.getColumnIndex("_id"))); u.setContent(cur.getString(cur.getColumnIndex("content"))); u.setDatetime(cur.getString(cur.getColumnIndex("datetime"))); ls.add(u); } return liUse; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public void onClick(View arg0) { // TODO Auto-generated method stub switch (arg0.getId()) { case R.id.refresh: shuaxin(); break; case R.id.add: Intent intent=new Intent(this,AddConActivity.class); startActivity(intent); break; default: break; } } public void DbInit(){ DBHelper dbHelper=new DBHelper(this, "Cotext.db", null, 1); db=dbHelper.getWritableDatabase(); } class DBHelper extends SQLiteOpenHelper{ public DBHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase arg0) { // TODO Auto-generated method stub SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss "); Date curDate = new Date(System.currentTimeMillis());//获取当前时间 String str = formatter.format(curDate); arg0.execSQL("create table user ( _id integer primary key autoincrement , datetime text not null , content varchar(100))"); ContentValues cv=new ContentValues(); cv.put("datetime", str); cv.put("content", "测试"); arg0.insert("user", "datetime", cv); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub } } private void shuaxin() { liUse=selectAll(); adapter.setcotext(liUse); adapter.notifyDataSetInvalidated(); } } ``` get 和 set : ``` public class UserInfo implements Serializable{ private int id; private String datetime; private String content; public UserInfo() { // TODO Auto-generated constructor stub } public UserInfo(int id,String datetime,String content) { // TODO Auto-generated constructor stub this.setId(id); this.setContent(content); this.setDatetime(datetime); } public UserInfo(String datetime,String content) { // TODO Auto-generated constructor stub this.setContent(content); this.setDatetime(datetime); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getDatetime() { return datetime; } public void setDatetime(String datetime) { this.datetime = datetime; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } } 异常 ``` 04-23 16:48:45.585: E/AndroidRuntime(1823): FATAL EXCEPTION: main 04-23 16:48:45.585: E/AndroidRuntime(1823): Process: com.example.notepad, PID: 1823 04-23 16:48:45.585: E/AndroidRuntime(1823): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.notepad/com.example.notepad.MainActivity}: java.lang.NullPointerException 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread.access$800(ActivityThread.java:135) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.os.Handler.dispatchMessage(Handler.java:102) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.os.Looper.loop(Looper.java:136) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread.main(ActivityThread.java:5045) 04-23 16:48:45.585: E/AndroidRuntime(1823): at java.lang.reflect.Method.invokeNative(Native Method) 04-23 16:48:45.585: E/AndroidRuntime(1823): at java.lang.reflect.Method.invoke(Method.java:515) 04-23 16:48:45.585: E/AndroidRuntime(1823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 04-23 16:48:45.585: E/AndroidRuntime(1823): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 04-23 16:48:45.585: E/AndroidRuntime(1823): at dalvik.system.NativeStart.main(Native Method) 04-23 16:48:45.585: E/AndroidRuntime(1823): Caused by: java.lang.NullPointerException 04-23 16:48:45.585: E/AndroidRuntime(1823): at com.example.notepad.MyAdapter.getCount(MyAdapter.java:29) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.widget.ListView.setAdapter(ListView.java:480) 04-23 16:48:45.585: E/AndroidRuntime(1823): at com.example.notepad.MainActivity.onCreate(MainActivity.java:44) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.Activity.performCreate(Activity.java:5231) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) 04-23 16:48:45.585: E/AndroidRuntime(1823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163) 04-23 16:48:45.585: E/AndroidRuntime(1823): ... 11 more ```

android listview反复调用getview()

哪位大神帮忙看看,只要一滑动listview就会调用调用getView,我的listview和父view都是fill_parent啊 求帮忙! <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/shop_cat_relativeLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/grey" android:orientation="vertical" > <TextView android:id="@+id/total_textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="15dp" android:text="共 件商品" android:textColor="@color/black" android:textSize="20dip" /> <com.handmark.pulltorefresh.library.PullToRefreshListView xmlns:ptr="http://schemas.android.com/apk/res-auto" android:id="@+id/shop_cat_listView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:dividerHeight="1dp" android:fadingEdge="none" android:fastScrollEnabled="false" android:footerDividersEnabled="false" android:headerDividersEnabled="false" android:smoothScrollbar="true" android:layout_marginBottom="50dp" android:cacheColorHint="#00000000" android:listSelector="#00000000" /> </LinearLayout> <RelativeLayout android:id="@+id/shop_cat_bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/darkgrey" android:orientation="horizontal" > <TextView android:id="@+id/shop_cat_totalprice" android:layout_width="200dp" android:layout_height="fill_parent" android:layout_margin="15dp" android:text="合计:¥0.00" android:textColor="@color/white" android:textSize="15dp" /> <TextView android:id="@+id/go_pay" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/red" android:gravity="center" android:text="去结算" android:textColor="@color/white" android:textSize="15dp" /> </LinearLayout> </RelativeLayout> </RelativeLayout>

findviewbyid 空指针的问题

各位大侠,最近发现一个问题个人觉得非常诡异。 在oncreate 中 listView_test = (ListView) this.findViewById(R.id.listcardinfo); 为null。 但是 同一个页面中的一个button的 onClick方法确可以找到这个listview,并且赋值。 附上XML ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:umadsdk="http://schemas.android.com/apk/res/com.LoveBus" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF" android:orientation="vertical" > <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="测试" android:textColor="#000000" android:textSize="22.0dip" /> <include layout="@layout/home_title_layout"/> </RelativeLayout> <android.support.v4.view.ViewPager android:id="@+id/vPager" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" android:layout_weight="1.0" android:flipInterval="30" android:persistentDrawingCache="animation" /> </LinearLayout> ``` ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <ListView android:id="@+id/listcardinfo" android:layout_width="fill_parent" android:layout_height="fill_parent" > </ListView> </LinearLayout> ```

Android 中写了一个listview,运行就闪退

一个MainActivity中有三个Fragment(其中有个为MovieFrament),下面这个ViewingFragment是MovieFragment中的一个嵌套的Fragment package com.example.movie; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterViewFlipper; import android.widget.ImageView; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * A simple {@link Fragment} subclass. */ public class ViewingFragment extends Fragment { private ListView listView; private List<Movie2> movieList; private List<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>(); public ViewingFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_viewing,container,false); listView = (ListView) view.findViewById(R.id.mov_listview); movieList=initmovies(movieList); for (int i = 0; i < movieList.size(); i++) { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("name", movieList.get(i).getName()); map.put("imageId", movieList.get(i).getImageId()); map.put("director", movieList.get(i).getDirector()); map.put("charactors", movieList.get(i).getCharactors()); data.add(map); } SimpleAdapter adapter = new SimpleAdapter(getParentFragment().getActivity(), data, R.layout.movie2_item, new String[]{ "name", "imageId", "director" ,"charactors"}, new int[]{ R.id.txt_name, R.id.imageId, R.id.txt_director, R.id.txt_charactors}); listView.setAdapter(adapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //我们需要的内容,跳转页面或显示详细信息 Intent intent=new Intent(getActivity(),Mov_InfActivity.class); startActivity(intent); } }); return view; } private static List<Movie2> initmovies(List<Movie2> movieList) { Movie2 apple = new Movie2("悲伤逆流成河", R.mipmap.beishang,"导演:落落","主演:赵英博 任敏 辛云来"); movieList.add(apple); Movie2 banana = new Movie2("新灰姑娘", R.mipmap.huigul,"导演:琳恩.萨瑟兰","主演:Kristen"); movieList.add(banana); Movie2 orange = new Movie2("李茶的姑妈", R.mipmap.licha,"导演:吴昱翰","主演:黄才伦 艾伦 宋阳"); movieList.add(orange); Movie2 watermelon = new Movie2("胖子行动队", R.mipmap.pangzi,"导演:包贝尔 秦小珍","主演:包贝尔 文章 克拉拉"); movieList.add(watermelon); Movie2 pear = new Movie2("无双", R.mipmap.wushuang,"导演:庄文强","主演:周润发 郭富城 张静初"); movieList.add(pear); Movie2 grape = new Movie2("嘻哈英熊", R.mipmap.xiha,"导演:王琦","主演:林强 刘康 徐梦娟"); movieList.add(grape); Movie2 pineapple = new Movie2("影", R.mipmap.ying,"导演:张艺谋","主演:邓超 孙俪 郑恺"); movieList.add(pineapple); Movie2 strawberry = new Movie2("找到你", R.mipmap.zhaodaoni,"导演:吕乐","主演:姚晨 马伊俐 袁文康"); movieList.add(strawberry); return movieList; } }

Android ListView控件无法显示

显示不出来,显示的的是fragment布局的内容,程序没有报错,调试发现已经走过了runonuithread![图片说明](https://img-ask.csdn.net/upload/201711/03/1509711999_879713.png)![图片说明](https://img-ask.csdn.net/upload/201711/03/1509711946_74158.png)

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

Linux命令学习神器!命令看不懂直接给你解释!

大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢? 答案是必须有的!今天给大家推荐一款有趣而实用学习神器 — kmdr,让你解锁 Linux 学习新姿势...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

史上最全的 python 基础知识汇总篇,没有比这再全面的了,建议收藏

网友们有福了,小编终于把基础篇的内容全部涉略了一遍,这是一篇关于基础知识的汇总的文章,请朋友们收下,不用客气,不过文章篇幅肯能会有点长,耐心阅读吧爬虫(七十)多进程multiproces...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

大学一路走来,学习互联网全靠这几个网站,最终拿下了一把offer

大佬原来都是这样炼成的

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

立即提问
相关内容推荐