Code example for AsyncTaskLoader

Methods: onStartLoading

0
		super(context);
	} 
 
	@Override 
	protected void onStartLoading() { 
		super.onStartLoading(); 
		forceLoad();
		Log.d(TAG, "onStartLoading");
	} 
 
	@Override 
	public Storys loadInBackground() { 
		Storys res = null;
		try { 
			URL url = new URL(getContext().getString(R.string.url_stories));
			URLConnection urlConnection = url.openConnection();
			InputStream in = new BufferedInputStream(
					urlConnection.getInputStream());
			Gson gson = new Gson();
			Reader reader = new InputStreamReader(in);
			res = gson.fromJson(reader, Storys.class);