I want to Display / Retrieve Backendless data to Android listview but getting Blank screen , I searched and google a lot of things but result failed and I am stuck please help me, here is my code.
##############################
Main Activity
public class ParseActivity0 extends Activity { ListView listview; BackendlessCollection<FirstClass> orders; ProgressDialog mProgressDialog; ArrayAdapter<String> adapter; private String name; String bkendless; /**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See Add Android App Links | Android Studio | Android Developers for more information.
*/
private GoogleApiClient client; @Override
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listview_main1); Backendless.initApp( this, Default.APP_ID, Default.SECRET_KEY, Default.VERSION ); Bundle readBundle = new Bundle( ); readBundle.putString( Default.ROLE_TAG, Default.READ_ROLE ); Bundle writeBundle = new Bundle( ); writeBundle.putString( Default.ROLE_TAG, Default.READ_WRITE_ROLE );//------------------------------------------------------
final ArrayList<String> propertyTypes = new ArrayList<String>(); // final ArrayList<Integer> numOfRoomies = new ArrayList<Integer>();
//------------
Backendless.Persistence.of( FirstClass.class).find( new AsyncCallback<BackendlessCollection<FirstClass>>(){ @Override
public void handleResponse( BackendlessCollection<FirstClass> foundContacts ) { // all Contact instances have been found
final Iterator<FirstClass> iterator = foundContacts.getCurrentPage().iterator(); while (iterator.hasNext()) { FirstClass dialogOptionsObject = iterator.next(); propertyTypes.add(dialogOptionsObject.getName()); System.out.println("Retrived " + propertyTypes); // numOfRoomies.add( dialogOptionsObject.getNumOfRoomies() );
} } @Override
public void handleFault( BackendlessFault fault ) { // an error has occurred, the error code can be retrieved with fault.getCode()
} });
}
And here is FirsClass.class
public class FirstClass { private String name; public String getName() { return name; } public void setName( String name ) { this.name = name; } @Override
public String toString() { return “Country{” + “name='” + name + ‘'’ + ‘}’; }}
And Backendless data saved in table like This