خرید بک لینک

Vote count: 0

I am trying to add some sleep-time in my Asynctask because right now my ProgressDialog is too fast when there isn't much data to load.

I tried this:

@Override
protected Boolean doInBackground(Void... params) {
    try {
        progressDialog.setMessage("Loading first thing...");
        firstThing();
        progressDialog.incrementProgressBy(1);
        Thread.sleep(500);
        //...repeat above four lines a few times for second, third, fourth thing, etc
        return true;
    }
    catch (Exception e) {
        Log.e("MyClassName", "There was an error: " + e);
    }
}

I am getting the error "Only the original thread that created a view can touch its views."

asked 19 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 23 مهر 1395 ساعت: 14:58

صفحه بندی