android / architecture-samples

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
Apache License 2.0
44.5k stars 11.65k forks source link

[todo-mvp-contentproviders ] A NullPointerException #173

Closed artharyoung closed 6 years ago

artharyoung commented 8 years ago

I had add three items in my All TO-DOs list. when i click on the checkbox in the first item, crashed! but the other items are OK.

09-05 14:25:00.055  9573  9573 D AndroidRuntime: Shutting down VM
09-05 14:25:00.057  9573  9573 E AndroidRuntime: FATAL EXCEPTION: main
09-05 14:25:00.057  9573  9573 E AndroidRuntime: Process: com.example.android.architecture.blueprints.todomvpcontentproviders.mock, PID: 9573
09-05 14:25:00.057  9573  9573 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.example.android.architecture.blueprints.todoapp.data.Task.getTitle()' on a null object refere
nce
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.data.FakeTasksRemoteDataSource.completeTask(FakeTasksRemoteDataSource.java:66)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.data.FakeTasksRemoteDataSource.completeTask(FakeTasksRemoteDataSource.java:73)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.data.source.TasksRepository.completeTask(TasksRepository.java:141)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.data.source.TasksRepository.completeTask(TasksRepository.java:135)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.tasks.TasksPresenter.completeTask(TasksPresenter.java:171)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.tasks.TasksFragment$1.onCompleteTaskClick(TasksFragment.java:68)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.example.android.architecture.blueprints.todoapp.tasks.TasksFragment$TasksCursorAdapter$1.onClick(TasksFragment.java:377)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.view.View.performClick(View.java:5207)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.widget.CompoundButton.performClick(CompoundButton.java:122)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.view.View$PerformClick.run(View.java:21177)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5438)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
09-05 14:25:00.057  9573  9573 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
JoseAlcerreca commented 8 years ago

I cannot reproduce. @malmstein ?

wyhwws commented 7 years ago

why,I also this erro

JoseAlcerreca commented 6 years ago

Branch is deprecated, closing!