Guest User

aaaaa

a guest
Jan 23rd, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.34 KB | None | 0 0
  1.  
  2.  
  3. ===============================================================================
  4. lists_secrets_single.xml
  5. ================================================================================
  6.  
  7.  
  8. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  9.     android:layout_width="wrap_content"
  10.     android:layout_height="wrap_content"
  11.     android:orientation="vertical"
  12.     >
  13.  
  14.  
  15.     <ImageView
  16.         android:layout_width="match_parent"
  17.         android:layout_height="290dp"
  18.         android:src="@drawable/left"
  19.         android:id="@+id/imgBubble"/>
  20.  
  21.     <TextView
  22.         android:layout_width="300dp"
  23.         android:layout_height="170dp"
  24.         android:text="this is a sample text"
  25.         android:layout_centerHorizontal="true"
  26.         android:layout_marginTop="30dp"
  27.         android:id="@+id/txtMsgp"
  28.         android:textSize="20sp"/>
  29.  
  30.     <LinearLayout
  31.         android:layout_width="300dp"
  32.         android:layout_height="35dp"
  33.         android:layout_below="@id/txtMsgp"
  34.         android:layout_centerHorizontal="true"
  35.         android:layout_marginTop="20dp"
  36.         android:gravity="center">
  37.  
  38.     </LinearLayout>
  39.  
  40. </RelativeLayout>
  41.  
  42.  
  43.  
  44. =========================================================================
  45. Users.java
  46. =====================================================
  47.  
  48. public class Users {
  49.  
  50.     public String userEmail;
  51.     public String userName;
  52.     public String userPass;
  53.     public String uuid;
  54.     public String userAge;
  55.     public String userNumber;
  56.     public String userGender;
  57.  
  58.     public Users() {
  59.     }
  60.  
  61.     public Users(String userEmail, String userName, String userPass, String uuid, String userAge, String userNumber, String userGender) {
  62.         this.userEmail = userEmail;
  63.         this.userName = userName;
  64.         this.userPass = userPass;
  65.         this.uuid = uuid;
  66.         this.userAge = userAge;
  67.         this.userNumber = userNumber;
  68.         this.userGender = userGender;
  69.     }
  70.  
  71.  
  72.     public void saveUser() {
  73.         Users user = new Users(userEmail, userName, userPass, uuid, userAge, userNumber, userGender);
  74.         FirebaseDatabase database = FirebaseDatabase.getInstance();
  75.         DatabaseReference myRef = database.getReference("Users");
  76.         myRef.child(uuid).setValue(user);
  77.     }
  78.  
  79. }
  80. ==================================================================================
Add Comment
Please, Sign In to add comment