i have class in parse.com
. class name classa
. class contains 1 column named owner
. multiple observations within classa
can have same owner
. trying formulate query based on owner
. query syntax this..
parsequery<parseobject> itemsall = new parsequery<parseobject>("classa"); itemsall.whereequalto("owner", "ownername"); list<parseobject> allitems = new arraylist<>(); try { allitems = itemsall.find(); } catch (parseexception e) { log.e("error", e.getmessage()); e.printstacktrace(); toast.maketext(getapplicationcontext(),"error syncing",toast.length_long).show(); } log.d("size", string.valueof(allitems.size()));
i have added parse authentication code in separate starterapplication.java
file. syntax is..
public class starterapplication extends application { @override public void oncreate() { super.oncreate(); // enable local datastore. parse.enablelocaldatastore(this); // add initialization code here parse.initialize(this, "app_key", "app_token"); parseuser.enableautomaticuser(); parseacl defaultacl = new parseacl(); // optionally enable public read access. // defaultacl.setpublicreadaccess(true); parseacl.setdefaultacl(defaultacl, true); } }
my android manifest
file looks this...
<application android:name=".starterapplication" android:allowbackup="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/customactionbartheme" > <activity android:name=".mainactivity" android:label="@string/app_name" android:screenorientation="portrait" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name=".activityone" android:label="@string/app_name" android:screenorientation="portrait" > </activity> </application>
i using above written query in both mainactivity
, activityone
. query produces correct result when called mainactivity
returns empty list (size 0) inside activityone
. can please wrong. can't quite figure out. in advance.
Comments
Post a Comment