Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@id/firstFragment">
<fragment
android:id="@+id/firstFragment"
android:name="com.ik.navigationjetpack.FirstFragment"
package com.ik.navigationjetpack
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.Navigation
import kotlinx.android.synthetic.main.fragment_first.*
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".SecondFragment"
android:gravity="center">
<TextView
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mobile_navigation"
app:startDestination="@id/firstFragment">
<fragment
android:id="@+id/firstFragment"
android:name="com.ik.navigationjetpack.FirstFragment"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".FirstFragment">
<TextView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<fragment
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha01
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha01'
@ismkhanh
ismkhanh / linkedlist_print_all_elements.md
Created November 9, 2017 11:28
Print all the elements of LinkedList
        /**
         * Print the values of the list
         */
        public void print() {

            System.out.print("LinkedList: [");

            Node current = head;
@ismkhanh
ismkhanh / linkedlist_delete_item.md
Last active November 9, 2017 11:30
Deleting item from LinkedList
        /**
         * Deletes the value, if present, from the list
         *
         * @param value to be deleted
         */
        public void deleteItem(int value) {

            if (head != null) { //if head is null no items to delete
@ismkhanh
ismkhanh / linkedlist_add_item_at_last.md
Last active November 9, 2017 11:30
Adding an item to LinkedList
        /**
         * Adds elements at the end of the list
         *
         * @param value to be added
         */
        public void addItem(int value) {

            Node newNode = new Node(value);