Ok, grazie, nel frattempo ero riuscito a capire, solo che a modifica effettuata, l'app si blocca,
attualmente ho fatto:
public View getView(int pos, View child, ViewGroup parent) {
Holder mHolder;
LayoutInflater layoutInflater;
if (child == null) {
layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
child = layoutInflater.inflate(R.layout.row, null);
mHolder = new Holder();
mHolder.txt_turno = (TextView) child.findViewById(R.id.txt_turno);
mHolder.txt_ore = (TextView) child.findViewById(R.id.txt_ore);
mHolder.txt_id = (TextView) child.findViewById(R.id.txt_id);
child.setTag(mHolder);
} else {
mHolder = (Holder) child.getTag();
}
mHolder.txt_turno.setText(turnoName.get(pos));
String nomeTurno = turnoName.get(pos);
if (nomeTurno.equals("M"))
mHolder.txt_turno.setTextColor(Color.RED);
else if (nomeTurno.equals("F"))
mHolder.txt_turno.setTextColor(Color.YELLOW);
else
mHolder.txt_turno.setTextColor(Color.BLACK);
mHolder.txt_ore.setText(oreName.get(pos));
mHolder.txt_id.setText(dataName.get(pos));
return child;
}
ma l'app mi da un fatal error
04-16 14:19:43.275: E/AndroidRuntime(11365): FATAL EXCEPTION: main
04-16 14:19:43.275: E/AndroidRuntime(11365): java.lang.NullPointerException
04-16 14:19:43.275: E/AndroidRuntime(11365): at com.turniDB.DisplayAdapter.getView(DisplayAdapter.java:65)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.AbsListView.obtainView(AbsListView.java:2033)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.ListView.makeAndAddView(ListView.java:1772)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.ListView.fillDown(ListView.java:672)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.ListView.fillFromTop(ListView.java:732)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.ListView.layoutChildren(ListView.java:1611)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.AbsListView.onLayout(AbsListView.java:1863)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.View.layout(View.java:11278)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.os.Handler.dispatchMessage(Handler.java:99)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.os.Looper.loop(Looper.java:137)
04-16 14:19:43.275: E/AndroidRuntime(11365): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-16 14:19:43.275: E/AndroidRuntime(11365): at java.lang.reflect.Method.invokeNative(Native Method)
04-16 14:19:43.275: E/AndroidRuntime(11365): at java.lang.reflect.Method.invoke(Method.java:511)
04-16 14:19:43.275: E/AndroidRuntime(11365): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-16 14:19:43.275: E/AndroidRuntime(11365): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-16 14:19:43.275: E/AndroidRuntime(11365): at dalvik.system.NativeStart.main(Native Method)
04-16 14:19:43.655: I/dalvikvm(11365): threadid=3: reacting to signal 3
04-16 14:19:43.686: I/dalvikvm(11365): Wrote stack traces to '/data/anr/traces.txt'
04-16 14:19:43.905: I/dalvikvm(11365): threadid=3: reacting to signal 3
04-16 14:19:43.925: I/dalvikvm(11365): Wrote stack traces to '/data/anr/traces.txt'
04-16 14:21:16.325: I/Process(11365): Sending signal. PID: 11365 SIG: 9