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 trialMUZ140028 Charlton Sibanda
5,615 Pointsurgent help please!!
Switch to the file InviteActivity.java. Set pushQuery using the appropriate static method from the ParseInstallation class.
import android.app.Activity;
import android.os.Bundle;
import com.parse.ParseInstallation;
import com.parse.ParseUser;
public class LoginActivity extends Activity {
/*
* Some code has been omitted for brevity!
* This method gets called upon a successful login.
*/
public void updateParseInstallation() {
String currentUserId = ParseUser.getCurrentUser().getObjectId();
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("userId",currentUserId);
installation.saveInBackground();
}
}
import android.app.Activity;
import android.os.Bundle;
import com.parse.ParseInstallation;
import com.parse.ParseQuery;
public class InviteActivity extends Activity {
/*
* Some code has been omitted for brevity!
* This method gets called when an invitation is sent.
*/
public void sendPushNotifications(String playerId) {
ParseQuery<ParseInstallation> pushQuery = ParseInstallation.getQuery();;
ParseQuery push=new ParseQuery();
push.setQuery(query);
}
}
MUZ140028 Charlton Sibanda
5,615 Pointsit is giving me error
./InviteActivity.java:16: error: cannot find symbol push.setQuery(query); ^ symbol: variable query location: class InviteActivity 1 error
5 Answers
Mark Sheekey
10,569 PointsActually, you dont need the last 2 lines of your code.
MUZ140028 Charlton Sibanda
5,615 Pointsthanks a lot Mark Sheehey
MUZ140681 Tatenda Muchaziwepi
4,340 Pointscopy n paste
import android.app.Activity; import android.os.Bundle; import com.parse.ParseInstallation; import com.parse.ParseQuery;
public class InviteActivity extends Activity {
/*
* Some code has been omitted for brevity!
* This method gets called when an invitation is sent.
*/
public void sendPushNotifications(String playerId) {
ParseQuery<ParseInstallation> pushQuery = ParseInstallation.getQuery();;
}
}
Mark Sheekey
10,569 PointsI think you should be using push.setQuery(push);
"push" is where you have set up your query, not the variable "query"
MUZ140028 Charlton Sibanda
5,615 Pointsnow its saying
/InviteActivity.java:17: error: cannot find symbol push.setQuery(push); ^
symbol: method setQuery(ParseQuery)
location: variable push of type ParseQuery 1 error
Chris Casey
11,656 PointsParseQuery pushQuery = ParseInstallation.getQuery();
Is the line of code needed to complete this stage of the challenge.
MUZ140202 Oniel Chamburuka
5,250 PointsParseQuery query = ParseInstallation.getQuery();
this is the code that works in the challenge
Mark Sheekey
10,569 PointsMark Sheekey
10,569 PointsWhat's the problem?