Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
alex gwartney
8,849 Pointsparse.com has stooped working when doing signup?
So not sure how to fix this since im not even getting some sort of error. When i go to sign up with the program it just says sorry parse has stoped working and then brings me back to my log in. I have posted my manifest my sign up and my extended Application file
package alexgwartney.parseproject;
import android.app.AlertDialog;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.SignUpCallback;
public class signupactivity extends ActionBarActivity {
protected EditText mUsername;
protected EditText mPassword;
protected EditText mEmail;
protected Button mSingnUpButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signupactivity);
mUsername = (EditText) findViewById(R.id.usernamefield);
mPassword = (EditText) findViewById(R.id.passwordfeild);
mEmail = (EditText) findViewById(R.id.emailfield);
mSingnUpButton = (Button) findViewById(R.id.signupbutton);
mSingnUpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String username = mUsername.getText().toString();
String password = mPassword.getText().toString();
String email = mPassword.getText().toString();
username.trim();
password.trim();
email.trim();
if(username.isEmpty() || password.isEmpty() || email.isEmpty()){
AlertDialog.Builder builder = new AlertDialog.Builder(signupactivity.this);
builder.setMessage(R.string.Signuperror)
.setTitle(R.string.SignuperrorTitle)
.setPositiveButton(android.R.string.ok,null);
AlertDialog dialog = builder.create();
dialog.show();
}else{
ParseUser user = new ParseUser();
user.setUsername(username);
user.setPassword(password);
user.setEmail(email);
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if(e == null){
Intent intent = new Intent(signupactivity.this,MainActivity.class);
startActivity(intent);
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}else{
}
}
});
}
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="alexgwartney.parseproject" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" android:name=".parseapplication" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LogInActivity"
android:label="@string/title_activity_log_in" >
</activity>
<activity
android:name=".signupactivity"
android:label="@string/title_activity_signupactivity"
android:parentActivityName=".LogInActivity"
>
</activity>
</application>
</manifest>
package alexgwartney.parseproject;
import android.app.Application;
import com.parse.Parse;
/**
* Created by alex on 6/27/2015.
*/
public class parseapplication extends Application{
@Override
public void onCreate(){
super.onCreate();
Parse.enableLocalDatastore(this);
Parse.initialize(this, "E5tyxQDVFwAutEwG8yIJv06QuJ860F17n5I0HN82", "lpMNMuS8O7Uaf1AWoXvp9ohsq3sxoAFBisAG5bwy");
}
}
5 Answers
Jon Kussmann
Courses Plus Student 7,254 PointsI'm not sure if this will fix your error, but you probably should not be calling startActivity() twice in your signupactivity. I would get rid of the first one.
alex gwartney
8,849 Pointsyea i saw that and it did not work there was also a part in there were i was getting the wrong text value but that also did not work
alex gwartney
8,849 Pointsi just really dont no were to go from here because no matter what i change it just says parse has stopped working and brings me back to the log in screen. I copyed the tutorial exactly but not sure what im doing wrong
Jon Kussmann
Courses Plus Student 7,254 PointsCan you post your logcat?
alex gwartney
8,849 Pointsthere is nothing in the log cat to show ither wise i would what im going to try and do is restart this thing from scratch and download the pronect files that parse gives me now instead of doing it all manually like shown in the video and see if i cant get it to work that way.
alex gwartney
8,849 Pointsi got this conected again i was not able to fix it with this code but what i did was downloaded the project template from parse it self and built it off from that so now it conects.