android - Why is Parse Query Adapter always empty? -
i trying fill list parse query adapter empty. following tutorial provided parse (https://parse.com/tutorials/parse-query-adapter). please tell me if doing wrong. how can make work ? thank
public class brandsfragment extends fragment { private parsequeryadapter mainadapter; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); sethasoptionsmenu(true); mainadapter = new parsequeryadapter(getactivity(), "brands"); mainadapter.settextkey("brandname"); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_brands, container, false); listview listfollowingview = (listview) rootview.findviewbyid(r.id.brands_list); brands_list.setadapter(mainadapter); mainadapter.loadobjects(); if(mainadapter.isempty()){ toast.maketext(getactivity(),"empty",toast.length_short).show(); } } }
layout :
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="com.swipeit.swipeit.brandsactivity$placeholderfragment"> <listview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/brands_list" /> </relativelayout>
Comments
Post a Comment