বাংলায় অ্যান্ড্রয়েড সহায়িকা - Bangla Android Guide

রেজাল্ট প্রদর্শন করতে একটি পদ্ধতি নির্ধারণ করা

doInBackground একটি String হিসাবে ঠিকানা অনুসন্ধানের ফলাফল (রেজাল্ট) ফেরত দেয়। এই ভ্যালু onPostExecute()এ পাস হয়, যেখানে আপনি রেজাল্টের আরও প্রক্রিয়া করবেন। যেহেতু onPostExecute()ইউআই থ্রেডে রান করে, এটা ইউজার ইন্টারফেস আপডেট করতে পাওে; উদাহরণস্বরূপ, এটা একটিভিটি ইন্ডিকেটর বন্ধ করে দিতে পারে এবং ইউজারের কাছে রেজাল্ট প্রদর্শন করতে পারে:

private class GetAddressTask extends
        AsyncTask<Location, Void, String> {
    ...
    /**
     * A method that's called once doInBackground() completes. Turn
     * off the indeterminate activity indicator and set
     * the text of the UI element that shows the address. If the
     * lookup failed, display the error message.
     */
    @Override
    protected void onPostExecute(String address) {
        // Set activity indicator visibility to "gone"
        mActivityIndicator.setVisibility(View.GONE);
        // Display the results of the lookup.
        mAddress.setText(address);
    }
    ...
}

সর্বশেষ ধাপ হচ্ছে ঠিকানা অনুসন্ধান রান করা।