Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Studio 3.5 Development Essentials - Java Edition

You're reading from   Android Studio 3.5 Development Essentials - Java Edition Developing Android 10 (Q) Apps Using Android Studio 3.5, Java, and Android Jetpack

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781951442019
Length 778 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Neil Smyth Neil Smyth
Author Profile Icon Neil Smyth
Neil Smyth
Arrow right icon
View More author details
Toc

Table of Contents (86) Chapters Close

1. Introduction FREE CHAPTER 2. Setting up an Android Studio Development Environment 3. Creating an Example Android App in Android Studio 4. Creating an Android Virtual Device (AVD) in Android Studio 5. Using and Configuring the Android Studio AVD Emulator 6. A Tour of the Android Studio User Interface 7. Testing Android Studio Apps on a Physical Android Device 8. The Basics of the Android Studio Code Editor 9. An Overview of the Android Architecture 10. The Anatomy of an Android Application 11. Understanding Android Application and Activity Lifecycles 12. Handling Android Activity State Changes 13. Android Activity State Changes by Example 14. Saving and Restoring the State of an Android Activity 15. Understanding Android Views, View Groups and Layouts 16. A Guide to the Android Studio Layout Editor Tool 17. A Guide to the Android ConstraintLayout 18. A Guide to using ConstraintLayout in Android Studio 19. Working with ConstraintLayout Chains and Ratios in Android Studio 20. An Android Studio Layout Editor ConstraintLayout Tutorial 21. Manual XML Layout Design in Android Studio 22. Managing Constraints using Constraint Sets 23. An Android ConstraintSet Tutorial 24. A Guide to using Apply Changes in Android Studio 25. An Overview and Example of Android Event Handling 26. Android Touch and Multi-touch Event Handling 27. Detecting Common Gestures using the Android Gesture Detector Class 28. Implementing Custom Gesture and Pinch Recognition on Android 29. An Introduction to Android Fragments 30. Using Fragments in Android Studio - An Example 31. Modern Android App Architecture with Jetpack 32. An Android Jetpack ViewModel Tutorial 33. An Android Jetpack LiveData Tutorial 34. An Overview of Android Jetpack Data Binding 35. An Android Jetpack Data Binding Tutorial 36. Working with Android Lifecycle-Aware Components 37. An Android Jetpack Lifecycle Awareness Tutorial 38. An Overview of the Navigation Architecture Component 39. An Android Jetpack Navigation Component Tutorial 40. Creating and Managing Overflow Menus on Android 41. Animating User Interfaces with the Android Transitions Framework 42. An Android Transition Tutorial using beginDelayedTransition 43. Implementing Android Scene Transitions – A Tutorial 44. Working with the Floating Action Button and Snackbar 45. Creating a Tabbed Interface using the TabLayout Component 46. Working with the RecyclerView and CardView Widgets 47. An Android RecyclerView and CardView Tutorial 48. A Layout Editor Sample Data Tutorial 49. Working with the AppBar and Collapsing Toolbar Layouts 50. An Android Studio Master/Detail Flow Tutorial 51. An Overview of Android Intents 52. Android Explicit Intents – A Worked Example 53. Android Implicit Intents – A Worked Example 54. Android Broadcast Intents and Broadcast Receivers 55. A Basic Overview of Threads and AsyncTasks 56. An Overview of Android Started and Bound Services 57. Implementing an Android Started Service – A Worked Example 58. Android Local Bound Services – A Worked Example 59. Android Remote Bound Services – A Worked Example 60. An Android Notifications Tutorial 61. An Android Direct Reply Notification Tutorial 62. Foldable Devices and Multi-Window Support 63. An Overview of Android SQLite Databases 64. The Android Room Persistence Library 65. An Android TableLayout and TableRow Tutorial 66. An Android Room Database and Repository Tutorial 67. Accessing Cloud Storage using the Android Storage Access Framework 68. An Android Storage Access Framework Example 69. Implementing Video Playback on Android using the VideoView and MediaController Classes 70. Android Picture-in-Picture Mode 71. An Android Picture-in-Picture Tutorial 72. Making Runtime Permission Requests in Android 73. Android Audio Recording and Playback using MediaPlayer and MediaRecorder 74. Working with the Google Maps Android API in Android Studio 75. Printing with the Android Printing Framework 76. An Android HTML and Web Content Printing Example 77. A Guide to Android Custom Document Printing 78. An Introduction to Android App Links 79. An Android Studio App Links Tutorial 80. A Guide to the Android Studio Profiler 81. An Android Biometric Authentication Tutorial 82. Creating, Testing and Uploading an Android App Bundle 83. An Overview of Android Dynamic Feature Modules 84. An Android Studio Dynamic Feature Tutorial 85. An Overview of Gradle in Android Studio Index

51.3 Returning Data from an Activity

As the example in the previous section stands, while data is transferred to ActivityB, there is no way for data to be returned to the first activity (which we will call ActivityA). This can, however, be achieved by launching ActivityB as a sub-activity of ActivityA. An activity is started as a sub-activity by starting the intent with a call to the startActivityForResult() method instead of using startActivity(). In addition to the intent object, this method is also passed a request code value which can be used to identify the return data when the sub-activity returns. For example:

startActivityForResult(i, REQUEST_CODE);

In order to return data to the parent activity, the sub-activity must implement the finish() method, the purpose of which is to create a new intent object containing the data to be returned, and then calling the setResult() method of the enclosing activity, passing through a result code and the intent containing the return...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image