googlecodelabs / android-build-an-app-architecture-components

Other
266 stars 133 forks source link

Step 9, LifecycleActivity #23

Open csaba-csete-87 opened 6 years ago

csaba-csete-87 commented 6 years ago

Since the January 22, 2018 release of Architecture components, LifecycleActivity is deprecated.

The build.gradle file can be updated to:

implementation "android.arch.lifecycle:runtime:1.1.1"
implementation "android.arch.lifecycle:extensions:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"

and at point 4.) Open ui.detail.DetailActivity. Have DetailActivity extend LifecycleActivity instead of AppCompatActivity. we should just keep it AppCompatActivity

egealpay commented 6 years ago

I guess we should keep it as: public class DetailActivity extends AppCompatActivity implements LifecycleOwner

edit: As I saw, I was wrong. But not sure about what should we do so I am also looking for an answer for this question