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 trialSidharth Kaushik
3,431 PointsEverything is changed on parse.com i tries to add parse.com jar file acc. to video
How can we add latest jar file to our application of parse.com . and when i was checking out like getting started the links and everything has been changed please help me here in this video's latest part creating jar files of parse.com to application and how to connect application to parse.com
20 Answers
Steve Hunter
57,712 PointsHi there,
Parse has changed, yes. Indeed, in under a year it won't exist. I don't think they are accepting new applications into the service for this reason. Existing applications are being migrated away from their databases.
Here is the first paragraph from an email Parse issued to its users back in January:
We have a difficult announcement to make. Beginning today we're winding down the Parse service, and Parse will be fully retired after a year-long period ending on January 28, 2017. We're proud that we've been able to help so many of you build great mobile apps, but we need to focus our resources elsewhere.
Further info can be found in gitHub here.
I don't know what provision Treehouse are making for this change.
Steve.
Sidharth Kaushik
3,431 PointsSomehow i got success in that i have one more doubt getting an error here
package com.sidharthkaushik.chitchat;
import android.app.ActionBar;
import android.content.Intent;
import android.nfc.Tag;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import com.parse.ParseAnalytics;
import com.parse.ParseUser;
public class MainActivity extends AppCompatActivity {
public static final String TAG = MainActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ParseAnalytics.trackAppOpenedInBackground(getIntent());
ParseUser currentuser = ParseUser.getCurrentUser();
if(currentuser == null) {
navigateToLogin();
}
else {
Log.i(TAG, currentuser.getUsername());
}
}
private void navigateToLogin() {
Intent intent = new Intent(this, LoginActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onCreateOptionsMenu(MenuItem menu) {
// Inflate the menu; this adds items to the action bar if it is present.
int itemId = item.getItemId();
if (itemId == R.id.action_logout) {
ParseUser.logOut();
navigateToLogin();
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Sidharth Kaushik
3,431 Pointserrors are described below
Sidharth Kaushik
3,431 Pointscan not resolve symbol item in above code and menu_main.xml is here
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<item android:id="@+id/action_logout"
android:title="@string/menu_logout_label"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>
Sidharth Kaushik
3,431 Pointsand how can i get a option in android studio down below of code layout/text ????
Steve Hunter
57,712 PointsThis line:
int itemId = item.getItemId();
Don't you want to use the menu
instance that was passed in as a parameter?
public boolean onCreateOptionsMenu(MenuItem menu) { // <-- menu passed in here
// Inflate the menu; this adds items to the action bar if it is present.
int itemId = item.getItemId(); // <-- item doesn't exist? Try using menu?
Steve.
Sidharth Kaushik
3,431 Pointscan you help me please through teamviewer ?
Steve Hunter
57,712 PointsI'm just opening my old version of Ribbit to see whether that can offer any ideas! Give me a minute.
Sidharth Kaushik
3,431 Pointsokay
Sidharth Kaushik
3,431 Pointsactually it will be better if you are able to upload that project zip file on mediafire and can give me a link it will help me a lot. Thanks
Steve Hunter
57,712 PointsI think it is in Git, so I can share it via that. It is just indexing/building - I'll get back to you once that's done.
There are some differences in my code that might help you - although my project is wholly complete so it'll have stuff in it that you've not come across yet. But I can see some ideas for the item
and menu
objects that are causing you problems.
Here's some of my code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
switch(itemId) {
case R.id.action_logout: // <-- ignore this; you'll get there later
ParseUser.logOut();
navigateToLogin();
You've used the logout action inside the menu creation method, not the item selection method. See what I mean?
Steve.
Sidharth Kaushik
3,431 Pointscan you share the git link please sir
Steve Hunter
57,712 PointsYes, if you give me a minute, I will. I need to push the project up; it isn't stored remotely. This is not a working project, but that part of it is fine. Give me a little more time.
Steve Hunter
57,712 PointsGitHub. Upload took a long time as there's the full icon set in there too.
Don't just copy loads out of this as the app is broken. I've used it to try out all sorts of stuff and to help people in the forum so the code is a bit out of sorts in places. The main menu stuff works OK, though.
Sidharth Kaushik
3,431 Pointshow to edit .xml as layout not text ?
Steve Hunter
57,712 PointsThere's a tab at the bottom of the XML code window that switches between text & design. Try that?
Sidharth Kaushik
3,431 Pointshere is no tab
Steve Hunter
57,712 PointsMine has this:
https://goo.gl/photos/msmpDSuGEPnDMkts7
I can't see a way of disabling that either, which is odd.
Sidharth Kaushik
3,431 PointsThat's why i am asking for help on teamviewer even i can't tell everything here what i am facing
Steve Hunter
57,712 PointsSend me a link - I'll see what I can do.
Sidharth Kaushik
3,431 Pointslink for what ?
Sidharth Kaushik
3,431 Pointsteamviewer 10 google my id is 228 608 394 my pass. is for connection is 1402
Steve Hunter
57,712 PointsI'm downloading the app now - I'll let you know when I'm set up.
Steve Hunter
57,712 PointsGlad you got that mainly fixed. Sorry the Teamviewer expired; I got a work call, so I was busy.
Shout if you need a help with anything else; just @ mention me in your new thread and I'll try to get back to you ASAP.
Steve.
Sidharth Kaushik
3,431 PointsI need a bit help again Sir can you help now it is on EDIT FRIENDS ACTIVITY it is unable to start
Sidharth Kaushik
3,431 Points04-24 11:13:59.871 9485-9485/? E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.sidharthkaushik.chitchat, PID: 9485 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sidharthkaushik.chitchat/com.sidharthkaushik.chitchat.EditFriendsActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442) at android.app.ActivityThread.access$800(ActivityThread.java:156) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:211) at android.app.ActivityThread.main(ActivityThread.java:5373) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' at android.app.ListActivity.onContentChanged(ListActivity.java:243) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:386) at android.app.Activity.setContentView(Activity.java:2145) at com.sidharthkaushik.chitchat.EditFriendsActivity.onCreate(EditFriendsActivity.java:30) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2442) at android.app.ActivityThread.access$800(ActivityThread.java:156) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:211) at android.app.ActivityThread.main(ActivityThread.java:5373) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) 04-24 11:14:01.334 9485-9485/? I/Process﹕ Sending signal. PID: 9485 SIG: 9
Steve Hunter
57,712 PointsLooks like you have a failed ListView - is there one in your layout? And is it called R.id.list?
Sidharth Kaushik
Courses Plus Student 42 Points<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<item android:id="@+id/action_logout"
android:title="@string/menu_logout_label"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_edit_friends"
android:title="@string/menu_edit_friends_label"/>
<item android:id="@+id/action_camera"
android:title="@string/menu_camera_label"
android:icon="@drawable/ic_action_camera"
android:showAsAction="always"
/>
</menu>
Done with that problem here it is showing me an error AndroidStudio tells me "Should use app:showAsAction with the appcompat library" help me here please
Steve Hunter
57,712 PointsYou're using AppCompat as the Action Bar is deprecated. This always throws up all sorts of errors and issues. What theme are you running? Hopefully, something like:
<application
.
.
android:theme="@style/AppTheme" >
<style name="AppTheme"
parent="Theme.AppCompat.Light.DarkActionBar">
</style>
That's in your manifest file.
Have a look through this post on Stack Overflow for lots of other ideas of things to change or try. Googling these errors always provides lots of ideas - and trying them out, failing, trying again and again really is the best way of learning.
Steve.
Sidharth Kaushik
3,431 Pointscan you help me like yesterday Sir ! on teamviewer
Sidharth Kaushik
3,431 Pointsteamviewer id :- 228 608 394 pass. :- 7002 left it online for you access anytime but please as fast as possible
Steve Hunter
57,712 PointsSorry, I am out at the moment. It is my friend's birthday today so we're out for food and beers. Back later!
Sidharth Kaushik
3,431 PointsDone with it i have to replace android to app: checked out from developers.google.com