This is by far the best tutorial on Activities that I found on the web, thanks for that!
Question : when TaskDescriptionActivity is launched by the Mainactivity, would there be a way to get the âextraâ from the Intent (ADD_TASK_REQUEST) in the TaskDescriptionActivity? I.e. when more than one kind of task could be requested by the MainActivity?
Iâm having problem compiling this project in the latest Android Studio 2.0 after importing.
Iâm getting either âError:Cause: buildToolsVersion is not specified.â or âError:(21, 0) Gradle DSL method not found: âandroid()â
Possible causes:
The project âForgetMeNotâ may be using a version of the Android Gradle plug-in that does not contain the method (e.g. âtestCompileâ was added in 1.1.0). Fix plugin version and sync project
The project âForgetMeNotâ may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
@whasssaaahhh I apologize for the delay in getting back. You can definitely add an extra (something like EXTRA_TASK_TYPE) to the intent used to launch TaskDescriptionActivity.
intent.putExtra(EXTRA_TASK_TYPE, task.type)
Then in the TaskDescriptionActivity you can have something like:
String type = intent.getStringExtra(EXTRA_TASK_TYPE);
I think that save activity state to SharedPreferences at onStop() method is not such a good idea, since it can never be called by android. Last guaranteed method is onPause and that where google recommend to save the state. Am I right?
I am noticing a problem with this app, now. The saving functionality doesnât seem to work at this point. In fact, after adding the saving functionality, if I close the app via the recent apps screen, when it is reopened, not only does it not have any tasks on the list, but when I try to add one, it never appears in the list. I have tried on both an emulator and my own Android device. I donât see anything in logcat that seems pertinent, but it may be that I donât know what Iâm looking for. My emulator is running Android 5.1.1 and my personal device is running Android 6.0. If anyone has any advice, itâd be appreciated.
Other than that, this is a great tutorial! Thanks so much for these!
It works perfectly on Android Studio 2.2 with the emulator, although I did have to edit the build.gradle file with new SDK and buildTools versions. As an iOS developer, starting to get familiar with Android, I found it to be very useful.
I have one suggestion, though. At the end, it is not necessary to add onConfigurationChanged() to the activity, since youâre not doing anything there except calling the superclass. Perhaps either remove it, or add some other functionality to it in the tutorial to explain how itâs useful.
This tutorial is more than six months old, so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]