简体   繁体   English

Android:为什么聊天列表视图适配器无法正常工作?

[英]Android: Why chat list view adapter doesn't work properly?

I'm coding an android chat application when I call the adapter and try to add message it gets down & the chat Activity gets crush and I get back to the previous activity.当我调用适配器并尝试添加消息时,我正在编写一个 android 聊天应用程序,它会关闭并且聊天活动被粉碎,然后我回到上一个活动。 These are my classes : OneMessage.java:这些是我的课程: OneMessage.java:

package com.mycompany.myapp;

public class OneMessage
{
public boolean left;
public String text;
public OneMessage(boolean left,String text) {
super();
this.left=left;
this.text=text; 
}
} 

& kada.java =an adapter named k adapter : & kada.java = 一个名为k 适配器的适配器

package com.mycompany.myapp;
//imports here

public class kada extends ArrayAdapter<OneMessage> 
{
private TextView tv;
private List<OneMessage> list=new ArrayList<OneMessage>();
private LinearLayout space;
public void add(OneMessage object) {
list.add(object);
super.add(object); 
}
public kada(Context context,int textViewResourceId) {
super(context,textViewResourceId); 
}
public int getCount() {
return this.list.size(); 
}

@Override
public OneMessage getItem(int position)
{
return this.list.get(position);
}

@Override
public View getView(int position, View convertView, ViewGroup parent)
{
 View row=convertView;
 if (row==null) {
LayoutInflater li=(LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
li.inflate(R.layout.me,parent,false); 
 }
space=(LinearLayout) row.findViewById(R.id.space);
OneMessage om=getItem(position);
tv=(TextView) row.findViewById(R.id.textview);
tv.setText(om.text);
space.setGravity(om.left ? Gravity.LEFT : Gravity.RIGHT);
return row; 
}
public Bitmap decodeToBitmap(byte[] db) {
return BitmapFactory.decodeByteArray(db,0,db.length); 
}
}

This, is my log:这是我的日志:

10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2596)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1638)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7292)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.Choreographer.doCallbacks(Choreographer.java:790)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.Choreographer.doFrame(Choreographer.java:721)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.os.Handler.handleCallback(Handler.java:808)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.os.Handler.dispatchMessage(Handler.java:101)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.os.Looper.loop(Looper.java:166)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at android.app.ActivityThread.main(ActivityThread.java:7529)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at java.lang.reflect.Method.invoke(Native Method)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-31 00:39:33.204 32160 32160 E   AndroidRuntime                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               FATAL EXCEPTION: main
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               Process: com.mycompany.myapp, PID: 12826
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at com.mycompany.myapp.kada.getView(kada.java:36)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.AbsListView.obtainView(AbsListView.java:2428)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.ListView.measureHeightOfChildren(ListView.java:1420)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.ListView.onMeasure(ListView.java:1327)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:451)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at com.android.internal.policy.DecorView.onMeasure(DecorView.java:831)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2596)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1638)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7292)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.Choreographer.doCallbacks(Choreographer.java:790)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.Choreographer.doFrame(Choreographer.java:721)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.os.Handler.handleCallback(Handler.java:808)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.os.Handler.dispatchMessage(Handler.java:101)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.os.Looper.loop(Looper.java:166)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at android.app.ActivityThread.main(ActivityThread.java:7529)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at java.lang.reflect.Method.invoke(Native Method)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-31 10:11:51.383 12826 12826 E   AndroidRuntime                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               FATAL EXCEPTION: main
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               Process: com.mycompany.myapp, PID: 27485
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at com.mycompany.myapp.kada.getView(kada.java:38)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.AbsListView.obtainView(AbsListView.java:2428)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.ListView.measureHeightOfChildren(ListView.java:1420)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.ListView.onMeasure(ListView.java:1327)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:451)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at com.android.internal.policy.DecorView.onMeasure(DecorView.java:831)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2596)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1638)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7292)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.Choreographer.doCallbacks(Choreographer.java:790)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.Choreographer.doFrame(Choreographer.java:721)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.os.Handler.handleCallback(Handler.java:808)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.os.Handler.dispatchMessage(Handler.java:101)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.os.Looper.loop(Looper.java:166)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at android.app.ActivityThread.main(ActivityThread.java:7529)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at java.lang.reflect.Method.invoke(Native Method)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-31 11:17:37.975 27485 27485 E   AndroidRuntime                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               FATAL EXCEPTION: main
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               Process: com.mycompany.myapp, PID: 28004
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at com.mycompany.myapp.kada.getView(kada.java:38)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.AbsListView.obtainView(AbsListView.java:2428)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.ListView.measureHeightOfChildren(ListView.java:1420)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.ListView.onMeasure(ListView.java:1327)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:451)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6671)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at com.android.internal.policy.DecorView.onMeasure(DecorView.java:831)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.View.measure(View.java:22216)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2596)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1638)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7292)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.Choreographer.doCallbacks(Choreographer.java:790)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.Choreographer.doFrame(Choreographer.java:721)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.os.Handler.handleCallback(Handler.java:808)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.os.Handler.dispatchMessage(Handler.java:101)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.os.Looper.loop(Looper.java:166)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at android.app.ActivityThread.main(ActivityThread.java:7529)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at java.lang.reflect.Method.invoke(Native Method)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
10-31 11:22:18.006 28004 28004 E   AndroidRuntime                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
10-31 14:21:40.206 12927 12927 I   zygote64                                     Late-enabling -Xcheck:jni
10-31 14:21:40.313 12927 12927 D   ActivityThread                               ActivityThread,attachApplication
10-31 14:21:40.421 12927 12942 I   HwApiCacheMangerEx                           apicache mCurPackageName=com.mycompany.myapp uptimes=209549163
10-31 14:21:40.424 12927 12927 D   HwFLClassLoader                              get used feature list :/feature/used-list failed!
10-31 14:21:40.424 12927 12927 D   HwFLClassLoader                              USE_FEATURE_LIST had not init!
10-31 14:21:40.425 12927 12942 I   HwApiCacheMangerEx                           apicache oUid null
10-31 14:21:40.428 12927 12942 I   HwApiCacheMangerEx                           apicache volumes null
10-31 14:21:40.456 12927 12942 I   HwApiCacheMangerEx                           apicache path=/storage/emulated/0 state=mounted key=com.mycompany.myapp#10773#256
10-31 14:21:40.478 12927 12942 I   HwApiCacheMangerEx                           apicache oUid 10773
10-31 14:21:40.478 12927 12942 I   HwApiCacheMangerEx                           apicache volumes null
10-31 14:21:40.480 12927 12942 I   HwApiCacheMangerEx                           apicache path=/storage/emulated/0 state=mounted key=com.mycompany.myapp#10773#0
10-31 14:21:40.480 12927 12942 I   HwApiCacheMangerEx                           apicache async read begin packageName=com.mycompany.myapp userid=0
10-31 14:21:40.480 12927 12942 I   HwApiCacheMangerEx                           apicache pi null
10-31 14:21:40.484 12927 12942 I   HwApiCacheMangerEx                           apicache pi null
10-31 14:21:40.485 12927 12942 I   HwApiCacheMangerEx                           apicache pi null
10-31 14:21:40.486 12927 12942 I   HwApiCacheMangerEx                           apicache oUid null
10-31 14:21:40.487 12927 12927 I   HwApiCacheMangerEx                           apicache pi null
10-31 14:21:40.488 12927 12942 I   HwApiCacheMangerEx                           apicache async read finished packageName=com.mycompany.myapp userid=0 totalus=7115
10-31 14:21:40.492 12927 12942 E   MemoryLeakMonitorManager                     MemoryLeakMonitor.jar is not exist!
10-31 14:21:40.520 12927 12927 I   HwCust                                       Constructor found for class android.app.HwCustActivityImpl
10-31 14:21:40.520 12927 12927 D   HwCust                                       Create obj success use class android.app.HwCustActivityImpl
10-31 14:21:40.524 12927 12927 V   HwPolicyFactory                              : success to get AllImpl object and return....
10-31 14:21:40.537 12927 12927 V   HwWidgetFactory                              : successes to get AllImpl object and return....
10-31 14:21:40.542 12927 12927 V   ActivityThread                               ActivityThread,callActivityOnCreate
10-31 14:21:40.574 12927 12927 D   CubicBezierInterpolator                      CubicBezierInterpolator  mControlPoint1x = 0.23, mControlPoint1y = 0.06, mControlPoint2x = 0.09, mControlPoint2y = 0.97
10-31 14:21:40.576 12927 12927 D   CubicBezierInterpolator                      CubicBezierInterpolator  mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
10-31 14:21:40.577 12927 12927 D   CubicBezierInterpolator                      CubicBezierInterpolator  mControlPoint1x = 0.23, mControlPoint1y = 0.06, mControlPoint2x = 0.09, mControlPoint2y = 0.97
10-31 14:21:40.578 12927 12927 D   CubicBezierInterpolator                      CubicBezierInterpolator  mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
10-31 14:21:40.611 12927 12927 D   HwGalleryCacheManagerImpl                    mIsEffect:false
10-31 14:21:40.681 12927 12927 D   HwWechatOptimizeImpl                         mIsEffect:false
10-31 14:21:40.733 12927 12927 D   HwRTBlurUtils                                check blur style for HwPhoneWindow, themeResId : 0x7f050000, context : com.mycompany.myapp.MainActivity@a6a9eee, Nhwext : 0, get Blur : disable with , null
10-31 14:21:40.737 12927 12927 W   WindowDecorActionBar                         should not do the transition or the transition anim is null or it is running or the mContainer view is null or mContainer view hasn't been drawn to screen
10-31 14:21:40.739 12927 12927 E   HwResourcesImpl                              readDefaultConfig : FileNotFoundException
10-31 14:21:40.773 12927 12927 I   HwCust                                       Constructor found for class android.content.res.HwCustHwResourcesImpl
10-31 14:21:40.773 12927 12927 D   HwCust                                       Create obj success use class android.content.res.HwCustHwResourcesImpl
10-31 14:21:40.933 12927 12933 I   zygote64                                     Do partial code cache collection, code=30KB, data=22KB
10-31 14:21:40.934 12927 12933 I   zygote64                                     After code cache collection, code=30KB, data=22KB
10-31 14:21:40.934 12927 12933 I   zygote64                                     Increasing code cache capacity to 128KB
10-31 14:21:40.969 12927 12927 D   ActivityThread                               add activity client record, r= ActivityRecord{380ab03 token=android.os.BinderProxy@2acc333 {com.mycompany.myapp/com.mycompany.myapp.MainActivity}} token= android.os.BinderProxy@2acc333
10-31 14:21:40.984 12927 12927 I   HwSecImmHelper                               mSecurityInputMethodService is null
10-31 14:21:40.998 12927 12927 D   OpenGLRenderer                               HWUI Binary is  disabled
10-31 14:21:41.080 12927 12965 D   OpenGLRenderer                               HWUI GL Pipeline
10-31 14:21:41.102 12927 12927 I   PressGestureDetector                         onAttached begin
10-31 14:21:41.103 12927 12927 I   PressGestureDetector                         onAttached end
10-31 14:21:41.109 12927 12966 I   PressGestureDetector                         HiTouch restricted: AboardArea.
10-31 14:21:41.157 12927 12965 I   Adreno                                       QUALCOMM build                   : 00d0768, Ie4790512f3
10-31 14:21:41.157 12927 12965 I   Adreno                                       Build Date                       : 06/25/18
10-31 14:21:41.157 12927 12965 I   Adreno                                       OpenGL ES Shader Compiler Version: EV031.20.00.04
10-31 14:21:41.157 12927 12965 I   Adreno                                       Local Branch                     :
10-31 14:21:41.157 12927 12965 I   Adreno                                       Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.6.5.R1.08.00.00.312.030
10-31 14:21:41.157 12927 12965 I   Adreno                                       Remote Branch                    : NONE
10-31 14:21:41.157 12927 12965 I   Adreno                                       Reconstruct Branch               : NOTHING
10-31 14:21:41.167 12927 12965 I   Adreno                                       PFP: 0x005ff087, ME: 0x005ff063
10-31 14:21:41.176 12927 12965 I   OpenGLRenderer                               Initialized EGL, version 1.4
10-31 14:21:41.176 12927 12965 D   OpenGLRenderer                               Swap behavior 2
10-31 14:21:41.190 12927 12965 E   vndksupport                                  Could not load vendor/lib64/egl/libGLES_mali.so from sphal namespace: dlopen failed: library "vendor/lib64/egl/libGLES_mali.so" not found.
10-31 14:21:41.450 12927 12927 W   InputMethodManager                           startInputReason = 1
10-31 14:21:41.492 12927 12927 W   InputMethodManager                           startInputReason = 5
10-31 14:21:41.805 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:41.805 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:41.819 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:41.819 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:41.832 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:41.832 12927 12927 E   SpannableStringBuilder                       SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
10-31 14:21:42.665 12927 12933 I   zygote64                                     Do partial code cache collection, code=61KB, data=49KB
10-31 14:21:42.665 12927 12933 I   zygote64                                     After code cache collection, code=60KB, data=49KB
10-31 14:21:42.665 12927 12933 I   zygote64                                     Increasing code cache capacity to 256KB
10-31 14:21:43.831 12927 12927 W   InputMethodManager                           startInputReason = 3
10-31 14:21:43.900 12927 12927 D   AndroidRuntime                               Shutting down VM
10-31 14:21:43.907 12927 12927 E   AndroidRuntime                               FATAL EXCEPTION: main
10-31 14:21:43.907 12927 12927 E   AndroidRuntime                               Process: com.mycompany.myapp, PID: 12927
10-31 14:21:43.907 12927 12927 E   AndroidRuntime                               java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
10-31 14:21:43.907 12927 12927 E   AndroidRuntime                               at com.mycompany.myapp.kada.getView(kada.java:38) 

I need to know the wrong in my code if exists & thanks.如果存在,我需要知道我的代码中的错误&谢谢。

I have found the problem myself :我自己发现了问题:

In the adapter java file kada.java when I need to inflate the bubble layout into the ListView, I hadn't defined the row View.在适配器 java 文件kada.java 中,当我需要将气泡布局膨胀到 ListView 中时,我没有定义视图。 The inflate code must be :膨胀代码必须是:

LayoutInflater li=(LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row=li.inflate(R.layout.me,parent,false); 

Instead of :而不是

LayoutInflater li=(LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
li.inflate(R.layout.me,parent,false); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM