Die zuvor gesendeten codes passen gar nicht zu diesem Login
Das Problem ist Solved war einfach eine Fehlende berechtigung auf die DB zuzugrifen zu dürfen nachdem ich dies geändert habe ging es kann geclosed werden.
Beiträge von Xeno
-
-
Stichwort: Reverse Engineering
-
Ich brauche deine Login.xml und wie hast du den Login btn initialisiert dafür am besten die LoginActivity.java die onCreate methode und bitte nutze den die tags damit der code leserlicher wird
-
In der Registrierung habe ich ref genauso initialisiert und dort funktioniert es?? mhmmm
in der onDataChange ist im übergabeparameter Datasnapshot dataSnapshot für das anlegen eines neuen DataSnapshots oder irre ich mich da?
Wenn ja wie würde der den aussehen da
Users usersData = new DataSnapshot funktioniert nicht
DatabaseReference ref = FirebaseDatabase.getInstance().getReference("Users").child("Ratlos");Was fragt der den dann im child ab?
Es geht eigentlich nur um diese stelle
if (usersData.getUserName().equals(name)) {// getUserName Nullpointer
getUserName() schmeißt mir einen NullPointer zurück
und mir fehlen lediglich die kenntnisse über der API und da ich faul bin wie man an meiner Schreibweiße evt schon erkennen konnte lerne ich nicht erst die API sonder stürze mich direkt ans angemacht habe ich bis jetzt jedes mal gemacht nur halt keine oop sondern sowas wie lua python oder auch nen bissl SQL
-
Java: Users
Alles anzeigenpackage com.example.codingcafe.ecommerce.Model; public class Users { private String name, phone, password, image, address; public Users() { } public Users(String name, String phone, String password, String image, String address) { this.name = name; this.phone = phone; this.password = password; this.image = image; this.address = address; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } }
Das ist eine gute Frage nein ich bin mir 0 sicher in allem was ich mache mein coden sieht so aus ich überlege mir was ich als nächstest tun muss dann google ich die schlüsselwörter wie z.B. Firebase Login with username and password.
Und dann bastel ich mir aus den ganzen code schnipseln die ich so finde etwas auf und hoffe das es funktioniert so wie ich es denke.Der Login ist durch Stackoverflow und 1 Yt video entstanden. Die Registrierung aus ca 4 srcs, natürlich Stackoverflow und 3 yt videos
Ich hatte den Login mit Auth und signInWithEmail hinbekommen nur weiß ich da dann nicht wie ich den userNamen mittels getter und setter erfrage und in z.B. der ProfileActivity anzeigen lasse da dann keine daten in der RealTime DB von Firebase geschickt werden die ich abfragen könnte.
-
Damit kann man nichts anfangen der komplette quellcode wäre nett mit nem fehlercode wäre ganz nett
Ansonsten ich sehe da kein angelegten pfad
was soll dort erstellt werden steht dort auch nichtund eine abfrage ob es erstellt wurde wäre auch super
-
final DatabaseReference ref = FirebaseDatabase.getInstance().getReference(); Z.57
vereinfachte form von
DatabaseReference ref;
ref = FireDatabase.getInstance().getReference();
oder liege ich da falsch? -
Java
Alles anzeigenpublic class LoginActivity extends AppCompatActivity { Button uLogin; EditText uPass,usName, uMail ; private static final int TIME_INTERVAL = 2000; private String parentDbName = "Users"; StringBuffer str = new StringBuffer(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); uLogin = (Button) findViewById(R.id.btn_log); usName = (EditText)findViewById(R.id.uName); uPass = (EditText) findViewById(R.id.pass); uMail = (EditText) findViewById(R.id.email); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Login"); } uLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Login(); } }); } void Login(){ String uNam = usName.getText().toString(); String uPas = uPass.getText().toString(); String uMai = uMail.getText().toString(); if(uNam.isEmpty()) { usName.setError("Please insert your Username"); usName.requestFocus(); } else if (uPas.isEmpty()) { uPass.setError("Please inser your password"); uPass.requestFocus(); } else { allowAccess(uPas, uNam); } } void allowAccess(final String uPass, final String name) { final DatabaseReference ref = FirebaseDatabase.getInstance().getReference(); ref.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if (dataSnapshot.child(parentDbName).child(name).exists()) { Users usersData = dataSnapshot.child(parentDbName).child(name).getValue(Users.class); try { if (usersData.getUserName().equals(name)) {// getUserName Nullpointer if (usersData.getPassword().equals(uPass)) { Toast.makeText(LoginActivity.this, "Login Successfull", Toast.LENGTH_SHORT).show(); Prevalent.currentOnlineUser = usersData; startActivity(new Intent(LoginActivity.this, NavigationActivity.class)); } else { Toast.makeText(LoginActivity.this, "Password is incorrect", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(LoginActivity.this, "Your " + name + " doesn't exist", Toast.LENGTH_SHORT).show(); } } catch (NullPointerException e) { e.printStackTrace(); } } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } private void checkEmailVerified() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { if (user.isEmailVerified()) { // user is verified, so you can finish this activity or send user to activity which you want. finish(); Toast.makeText(LoginActivity.this, "Successfully logged in", Toast.LENGTH_SHORT).show(); } else { // email is not verified, so just prompt the message to the user and restart this activity. // NOTE: don't forget to log out the user. FirebaseAuth.getInstance().signOut(); //restart this activity } } } @Override public void onBackPressed() { startActivity(new Intent (this,MainActivity.class)); finish(); /* if(mBackPressed + 1000 > System.currentTimeMillis()){ super.onBackPressed(); }else{ Toast.makeText(this, "Press once again to exit", Toast.LENGTH_SHORT).show(); } mBackPressed = System.currentTimeMillis();*/ } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case android.R.id.home: startActivity(new Intent(this, MainActivity.class)); finish(); return true; default: return super.onOptionsItemSelected(item); } } }
Ich habe es gemerkt mit dem onClick ic h weiß nicht wie mir dies passieren konnte hier der überarbeitete Z. 66
-
Hallo
Deine Methode allowAccess erwartet einen string und keinen editText.Wie meinst du das?
uName ist ein String siehe übergabe parameter und mittelsString uNam = usName.getText().toString();
mache ich uNam doch zum String oder?
-
NDK version is UNKNOWN
Dein Native Developement Kit ist nicht bekannt -
Code
Alles anzeigen2019-08-26 04:58:38.113 21904-16737/? E/SQLiteCastStore: Unable to insert probed socket address: 192.168.178.23/192.168.178.23:8009, CastProbedNetwork. Network ID: null, isDeviceRespondingToProbe: false, lastProbedTimestampMillis: 0, probingErrorCode: 0, numberOfProbedTimes: 0 2019-08-26 04:58:38.117 21904-16737/? E/SQLiteDatabase: Error inserting network_id=null port=8009 probing_error_code=0 number_of_probed_times=0 is_responding_to_probe=0 last_probed_timestamp_millis=0 host_name=192.168.192.42 android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: ProbedSocketAddress.network_id (code 1299 SQLITE_CONSTRAINT_NOTNULL[1299]) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:995) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:2021) at android.database.sqlite.SQLiteDatabase.replace(SQLiteDatabase.java:1937) at prc.b(:com.google.android.gms@[email protected] (100408-264672080):39) at pqq.b(:com.google.android.gms@[email protected] (100408-264672080):4) at pph.run(Unknown Source:2) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at src.b(:com.google.android.gms@[email protected] (100408-264672080):33) at src.run(:com.google.android.gms@[email protected] (100408-264672080):21) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at swy.run(Unknown Source:7) at java.lang.Thread.run(Thread.java:764) 2019-08-26 04:58:38.117 21904-16737/? E/SQLiteCastStore: Unable to insert probed socket address: 192.168.192.42/192.168.192.42:8009, CastProbedNetwork. Network ID: null, isDeviceRespondingToProbe: false, lastProbedTimestampMillis: 0, probingErrorCode: 0, numberOfProbedTimes: 0 2019-08-26 04:58:38.121 21904-16737/? E/SQLiteDatabase: Error inserting network_id=null port=8009 probing_error_code=0 number_of_probed_times=0 is_responding_to_probe=0 last_probed_timestamp_millis=0 host_name=192.168.0.108 android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: ProbedSocketAddress.network_id (code 1299 SQLITE_CONSTRAINT_NOTNULL[1299]) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:995) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:2021) at android.database.sqlite.SQLiteDatabase.replace(SQLiteDatabase.java:1937) at prc.b(:com.google.android.gms@[email protected] (100408-264672080):39) at pqq.b(:com.google.android.gms@[email protected] (100408-264672080):4) at pph.run(Unknown Source:2) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at src.b(:com.google.android.gms@[email protected] (100408-264672080):33) at src.run(:com.google.android.gms@[email protected] (100408-264672080):21) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at swy.run(Unknown Source:7) at java.lang.Thread.run(Thread.java:764) 2019-08-26 04:58:38.121 21904-16737/? E/SQLiteCastStore: Unable to insert probed socket address: 192.168.0.108/192.168.0.108:8009, CastProbedNetwork. Network ID: null, isDeviceRespondingToProbe: false, lastProbedTimestampMillis: 0, probingErrorCode: 0, numberOfProbedTimes: 0 2019-08-26 04:58:38.542 4543-4595/? E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0 2019-08-26 04:58:44.079 16376-16431/? E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.google.uid.shared, scannerId: 8, reportDelayMillis=0 2019-08-26 04:58:45.593 16376-22598/? E/BtGatt.ContextMap: remove() - removed: 8 2019-08-26 04:58:45.607 16376-16431/? E/BtGatt.GattService: [GSIM LOG]: gsimLogHandler,
Sry max 10000 Zeichen -.-
-
Code
Alles anzeigenD/ViewRootImpl@fb1df0a[LoginActivity]: ViewPostIme pointer 0 D/ViewRootImpl@fb1df0a[LoginActivity]: ViewPostIme pointer 1 W/ClassMapper: No setter/field for First_Name found on class com.example.supermarketdiscounter.Model.Users (fields/setters are case sensitive!) No setter/field for Last_Name found on class com.example.supermarketdiscounter.Model.Users (fields/setters are case sensitive!) W/ClassMapper: No setter/field for PhoneNumber found on class com.example.supermarketdiscounter.Model.Users No setter/field for Password found on class com.example.supermarketdiscounter.Model.Users (fields/setters are case sensitive!) W/ClassMapper: No setter/field for eMail found on class com.example.supermarketdiscounter.Model.Users W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference W/System.err: at com.example.supermarketdiscounter.LoginActivity$2.onDataChange(LoginActivity.java:84) W/System.err: at com.google.firebase.database.Query$1.onDataChange(com.google.firebase:firebase-database@@19.0.0:179) W/System.err: at com.google.firebase.database.core.ValueEventRegistration.fireEvent(com.google.firebase:firebase-database@@19.0.0:75) W/System.err: at com.google.firebase.database.core.view.DataEvent.fire(com.google.firebase:firebase-database@@19.0.0:63) W/System.err: at com.google.firebase.database.core.view.EventRaiser$1.run(com.google.firebase:firebase-database@@19.0.0:55) W/System.err: at android.os.Handler.handleCallback(Handler.java:873) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99) W/System.err: at android.os.Looper.loop(Looper.java:214) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6986) W/System.err: at java.lang.reflect.Method.invoke(Native Method) W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
-
Moin bin wieder da dieses mal mit dem Login anstatt der Registrierung
Java: LoginActivity
Alles anzeigenpublic class LoginActivity extends AppCompatActivity { Button uLogin; EditText uPass, usName , uMail; long mBackPressed; private static final int TIME_INTERVAL = 2000; private String parentDbName = "Users"; Users us; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Login"); } uLogin = findViewById(R.id.btn_log); usName = findViewById(R.id.uName); uPass = findViewById(R.id.pass); uMail = findViewById(R.id.email); uLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final String uNam = usName.getText().toString(); final String uPas = uPass.getText().toString(); final String mail = uMail.getText().toString(); if (uNam.isEmpty()) { usName.setError("Please insert your Username"); usName.requestFocus(); } else if (uPas.isEmpty()) { uPass.setError("Please inser your password"); uPass.requestFocus(); } else { allowAccess(uNam, uPas); } } }); } void allowAccess(final String uName,final String uPass) { final DatabaseReference ref = FirebaseDatabase.getInstance().getReference(); ref.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.child(parentDbName).child(uName).exists()) { Users usersData = dataSnapshot.child(parentDbName).child(uName).getValue(Users.class); try { if (usersData.getUserName().equals(uName)) { if (usersData.getPassword().equals(uPass)) { Toast.makeText(LoginActivity.this, "Login Successfull", Toast.LENGTH_SHORT).show(); Prevalent.currentOnlineUser = usersData; startActivity(new Intent(LoginActivity.this, NavigationActivity.class)); } else { Toast.makeText(LoginActivity.this, "Password is incorrect", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(LoginActivity.this, "Your " + uName + " doesn't exist", Toast.LENGTH_SHORT).show(); } }catch (NullPointerException e){ e.printStackTrace(); } } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } private void checkEmailVerified() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { if (user.isEmailVerified()) { // user is verified, so you can finish this activity or send user to activity which you want. finish(); Toast.makeText(LoginActivity.this, "Successfully logged in", Toast.LENGTH_SHORT).show(); } else { // email is not verified, so just prompt the message to the user and restart this activity. // NOTE: don't forget to log out the user. FirebaseAuth.getInstance().signOut(); //restart this activity } } } } package com.example.supermarketdiscounter; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.example.supermarketdiscounter.Model.Users; import com.example.supermarketdiscounter.Prevalent.Prevalent; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; public class LoginActivity extends AppCompatActivity { Button uLogin; EditText uPass, usName , uMail; long mBackPressed; private static final int TIME_INTERVAL = 2000; private String parentDbName = "Users"; Users us; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Login"); } uLogin = findViewById(R.id.btn_log); usName = findViewById(R.id.uName); uPass = findViewById(R.id.pass); uMail = findViewById(R.id.email); uLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final String uNam = usName.getText().toString(); final String uPas = uPass.getText().toString(); final String mail = uMail.getText().toString(); if (uNam.isEmpty()) { usName.setError("Please insert your Username"); usName.requestFocus(); } else if (uPas.isEmpty()) { uPass.setError("Please inser your password"); uPass.requestFocus(); } else { allowAccess(uNam, uPas); } } }); } void allowAccess(final String uName,final String uPass) { final DatabaseReference ref = FirebaseDatabase.getInstance().getReference(); ref.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.child(parentDbName).child(uName).exists()) { Users usersData = dataSnapshot.child(parentDbName).child(uName).getValue(Users.class); try { if (usersData.getUserName().equals(uName)) { if (usersData.getPassword().equals(uPass)) { Toast.makeText(LoginActivity.this, "Login Successfull", Toast.LENGTH_SHORT).show(); Prevalent.currentOnlineUser = usersData; startActivity(new Intent(LoginActivity.this, NavigationActivity.class)); } else { Toast.makeText(LoginActivity.this, "Password is incorrect", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(LoginActivity.this, "Your " + uName + " doesn't exist", Toast.LENGTH_SHORT).show(); } }catch (NullPointerException e){ e.printStackTrace(); } } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } private void checkEmailVerified() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { if (user.isEmailVerified()) { // user is verified, so you can finish this activity or send user to activity which you want. finish(); Toast.makeText(LoginActivity.this, "Successfully logged in", Toast.LENGTH_SHORT).show(); } else { // email is not verified, so just prompt the message to the user and restart this activity. // NOTE: don't forget to log out the user. FirebaseAuth.getInstance().signOut(); //restart this activity } } } }
Wie kriege ich den Nullpointer in Zeile 84 in der LoginActivity weg?
-
Ich gebs auf ich schreibs nomma komplett von neu wen ich Zeit dafür habe. Trz danke für deine Hilfe. Hatte spaßes halber etwas anderes angefangen um sachen zu testen habe dort dann die regi eingebaut und tadaaa es funktioniert dort. Aber hier nicht ich weiß nicht was ich falsch gemacht habe und finde den dummen fehler auch nicht -.-
-
Selber schreiben oder die vorhandene Datei anpassen
-
Java: AuthStateListener
Alles anzeigenmAuthStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { final String name = uName.getText().toString(); int selectID = uRadioGroup.getCheckedRadioButtonId(); final RadioButton radioButton = findViewById(selectID); final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if(user != null){ Intent intent4 = new Intent(RegisterActivity.this,MainActivity.class); startActivity(intent4); finish(); return; }else{ try { String userID = mAuth.getCurrentUser().getUid(); DatabaseReference currentUserDb = FirebaseDatabase.getInstance().getReference().child("Users").child(radioButton.getText().toString()) .child(userID).child("name"); currentUserDb.setValue(name); }catch (NullPointerException e){ e.printStackTrace(); } }
So meintest du es oder? Nur ich denke die if else muss umgeschrieben werden dafür oder?
-
Ich verstehe es nicht ich bin ein totaler newbie der die Grundkenntnisse besitzt sorry dafür.
Ist es im OnComplete nicht richtig?
-
Moin Moin ich schreibe gerade ein Login und eine Registrierung leider habe ich wen ich die Methode .getUid() nutze einen Nullpointer der es mir nicht möglich macht einen Button mit Male or Female funktionstüchtig einzufügen.
Java: RegisterActivity
Alles anzeigenpublic class RegisterActivity extends AppCompatActivity { private Button regi_btn; private EditText umail, upass,upass_conf, uFirstname, uName, uDate, uPhone; private ProgressDialog loading; private RadioGroup uRadioGroup; private FirebaseAuth mAuth; private FirebaseAuth.AuthStateListener mAuthStateListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); regi_btn = findViewById(R.id.btn_reg); umail = findViewById(R.id.email); upass = findViewById(R.id.pass); uName = findViewById(R.id.uname); uRadioGroup = findViewById(R.id.radioGroup); mAuth = FirebaseAuth.getInstance(); mAuthStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if(user != null){ Intent intent4 = new Intent(RegisterActivity.this,MainActivity.class); startActivity(intent4); finish(); return; } } }; regi_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final String name = uName.getText().toString(); final String email = umail.getText().toString(); final String pass = upass.getText().toString(); int selectID = uRadioGroup.getCheckedRadioButtonId(); final RadioButton radioButton = findViewById(selectID); if(radioButton.getText() == null){ return; } mAuth.createUserWithEmailAndPassword(email, pass).addOnCompleteListener(RegisterActivity.this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if(!task.isSuccessful()){ Toast.makeText(RegisterActivity.this, "sign_up_error" , Toast.LENGTH_SHORT).show(); }else{ try { String userID = mAuth.getCurrentUser().getUid(); DatabaseReference currentUserDb = FirebaseDatabase.getInstance().getReference().child("Users").child(radioButton.getText().toString()) .child(userID).child("name"); currentUserDb.setValue(name); }catch(NullPointerException e){ e.printStackTrace(); } } } }); } }); } @Override protected void onStart() { super.onStart(); mAuth.addAuthStateListener(mAuthStateListener); } @Override protected void onStop() { super.onStop(); mAuth.removeAuthStateListener(mAuthStateListener); } }
-
Du hast keinen Konstruktor ohne Konsturktor wird der dir das nicht annehmen
boolean spielaeuft;
int runde;
int punkte;punkte = x;
runde = x;private void starteRunde() {
//Dein Code für den Runden Start
}
das fehlt dir