https://kotlinlang.org logo
#android
Title
# android
j

jurajsolarml

01/07/2019, 1:09 PM
Hello,please Help. Validation don't work.Where can a bug be ? After clicking the registerUser, the second activity will not start.Thanks https://pastebin.com/E9cpgVhd https://pastebin.com/gRAitRD8
m

Mehdi

01/07/2019, 1:26 PM
Please note that : " regFirstName = findViewById(R.id.regFirstName) regLastName = findViewById(R.id.regLastName) regEmail = findViewById(R.id.regEmail) regPassword = findViewById(R.id.regPassword) regCnfpass = findViewById(R.id.regCnfpass) registerUser = findViewById(R.id.registerUser) " can be removed if you import "import kotlinx.android.synthetic.main.{yourActivity}.*"
Can you also show us your "DataSave" class ? I don't see a problem for now
j

jurajsolarml

01/07/2019, 1:39 PM
DataSave is a user save.
m

Mehdi

01/07/2019, 1:54 PM
must be a really really small mistake, in your Activity layout or setup. Because I don't see an error in your code. The only difference between what I see and a working example I have maybe is the decorator after "this" in your Main Activity's intent
did you try to make a Toast in your DataSave ? just to make sure you really open it.
j

jurajsolarml

01/07/2019, 2:29 PM
no, I did not try it
I have added DataSave: startActivity (intent) finish () Toast.makeText (this, "Sign Up Successfully", Toast.LENGTH_SHORT) .show () but without change: ((
m

Mehdi

01/07/2019, 2:46 PM
can you delete the finish() line ?
j

jurajsolarml

01/07/2019, 2:53 PM
Yes, without changing the same
m

Mehdi

01/07/2019, 2:57 PM
if you print a message after you finished the Activity ... 😄
j

jurajsolarml

01/07/2019, 3:02 PM
finish () line has been deleted but without change
m

Mehdi

01/07/2019, 3:08 PM
did you also remove the annotation after the context when you create the intent ?
If is still does not work, I have no idea what could cause that !
j

jurajsolarml

01/07/2019, 3:23 PM
I will try to
m

Mehdi

01/07/2019, 3:28 PM
If I were you I would take this line out of the click listener : val intent = Intent(this@RegisterActivity, DataSave::class.java) and remove "@RegisterActivity", let me know if that works
j

jurajsolarml

01/07/2019, 3:39 PM
without any change