为什么我的Android应用程序中Azure表存储数据加载速度慢?

时间:2015-07-07 05:35:51

标签: android azure

我用Azure表存储数据创建了Android应用程序..我每次打开我的应用程序Azure数据时都会打开... 我的表mBranchListTable = mClient.getTable(BranchList.class);

我的RemoteDataTask()代码

 private class RemoteDataTask extends AsyncTask<Void, Void, Void> {
    @Override
    protected void onPreExecute() {
        super.onPreExecute();

        mProgressDialog = new ProgressDialog(Branchs.this);

        mProgressDialog.setMessage("Loading...");
        mProgressDialog.setIndeterminate(true);

        mProgressDialog.show();
    }

    @Override
    protected Void doInBackground(Void... params) {
        try {

            final List<BranchList> results = mBranchListTable.where().field("enable").eq(val(true)).orderBy("sort", QueryOrder.Ascending).execute().get();

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mAdapter.clear();
                    for (BranchList item : results) {
                        mAdapter.add(item);

                    }
                }
            });
        } catch (Exception e) {
            createAndShowDialog(e, "Error");

        }

        return null;
    }


    @Override
    protected void onPostExecute(Void result) {

        mProgressDialog.dismiss();
    }
}

OnCreate中

    new RemoteDataTask().execute();
    mAdapter = new ToDoItemAdapter(this, R.layout.listview_item);
    ListView listViewToDo = (ListView) findViewById(R.id.LViewBranchList);
    listViewToDo.setAdapter(mAdapter);

0 个答案:

没有答案