FirebaseUI Firestore RecyclerView Part 4 – NEW NOTE ACTIVITY – Android Studio Tutorial

In part 4 of the FirebaseUI Firestore tutorial, we will add another activity to our app, from which the user can add a new document to the Firestore database. The activity will contain 2 EditText fields and a NumberPicker, from which we get the input values, create a new Note object, and add it to our Firestore collection. We override onCreateOptionsMenu to add our save button as a menu item and handle clicks on it in onOptionsItemSelected. To add an up button to the action bar, we add the parentActivityName attribute to the MainActivity tag in the AndroidManifest.xml file, and by setting launchMode to “singleTop” we avoid restarting this activity when we navigate back. To change the up arrow into a close (x) icon, we call setHomeAsUpIndicator on getSupportActionBar and pass a vector draw

It's only fair to share...Tweet about this on TwitterShare on FacebookShare on TumblrShare on Google+Digg thisShare on LinkedInPin on PinterestShare on VKShare on RedditPrint this pageEmail this to someone
Flattr the authorShare on StumbleUponShare on YummlyBuffer this page

Leave a Reply

Your email address will not be published. Required fields are marked *