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

Android

Problem in seeing Parse stored data

I can't see any data on the dashboard, even in the beginning test:

ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();

I click test and It says that it was a success, but I have nothing in the dashboard.

I believe that the problem is not in my code but perhaps some problem in my parse analytics definitions on the website.

my program is currently like this, and still no data in the dashboard and the callbacks are working just fine.

SingUpJava:

import android.app.AlertDialog;
import android.content.Intent;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.SignUpCallback;


public class SignUp extends AppCompatActivity {

protected EditText userName;
protected EditText eMail;
protected EditText PW;
protected Button signUp;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_up);

    userName = (EditText) findViewById(R.id.editTextUserName);
    eMail = (EditText) findViewById(R.id.editTextEmail);
    PW = (EditText) findViewById(R.id.editTextPW);
    signUp = (Button) findViewById(R.id.butSingUp);

    signUp.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            String mUserName = userName.getText().toString().trim();
            String mEmail = eMail.getText().toString().trim();
            String mPW = PW.getText().toString().trim();

            if (mUserName.isEmpty() || mEmail.isEmpty() || mPW.isEmpty())
            {
                AlertDialog.Builder builder = new AlertDialog.Builder(SignUp.this)
                .setMessage("Please enter your user name, password and Email address!")
                .setTitle("Ooops!")
                .setPositiveButton("Ok", null);
                AlertDialog dialog = builder.create();
                dialog.show();

            }
            else{
                // create a new user

                ParseUser newUser = new ParseUser();
                newUser.setUsername(mUserName);
                newUser.setPassword(mPW);
                newUser.setEmail(mEmail);
                newUser.signUpInBackground(new SignUpCallback() {

                    @Override
                    public void done(ParseException e) {

                        if (e == null)
                        {
                            Intent intent = new Intent(SignUp.this, MainActivity.class);
                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
                            startActivity(intent);

                        }

                        else {

                            AlertDialog.Builder builder = new AlertDialog.Builder(SignUp.this)
                                    .setMessage(e.getMessage())
                                    .setTitle("Ooops!")
                                    .setPositiveButton("Ok", null);
                            AlertDialog dialog = builder.create();
                            dialog.show();

                        }
                    }
                });




            }



        }
    });





}

RibbitApplicationJava:

import android.app.Application;

import com.parse.Parse;



public class RibbitApplication extends Application{

@Override
public void onCreate() {
    super.onCreate();

// Enable Local Datastore.
    Parse.enableLocalDatastore(this);

    Parse.initialize(this, "xxxxx", "xxxxx");


}

}

MainActivityJava:

import android.content.Intent;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;


import com.parse.ParseAnalytics;



public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ParseAnalytics.trackAppOpenedInBackground(getIntent());


    Intent intent = new Intent(this,Login.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    startActivity(intent);





}