@Override public void onCreate(Bundle icicle) { // onCreate - save the instance state super.onCreate(icicle); // Set sharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); PublicUtils.restoreCookies(this, icicle); // Setup the locale PublicUtils.setupLocale(this, sharedPreferences); // Set the content view setContentView(R.layout.forum_search_view); // Prepare to tango this.layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Get the elements buttonSearch = (Button) findViewById(R.id.button_search); fieldSearch = (EditText) findViewById(R.id.field_search); // Threads! threads = new ArrayList<ForumSearchResult>(); setupList(threads); }
@Override protected void onPostExecute(Boolean results) { // Let's evaluate if (results) { if (context instanceof ForumSearchActivity) { ((ForumSearchActivity) context).setupList(threads); ((ForumSearchActivity) context).toggleSearchButton(); } } else { if (context instanceof ForumSearchActivity) { ((ForumSearchActivity) context).toggleSearchButton(); } Toast.makeText(context, R.string.info_xml_generic_error, Toast.LENGTH_SHORT).show(); } }