Hello to all i have some questions...
I am making new app with imageviews and loading images from web, and i wrote the code and first time the images are downloaded but next time when i open app it load the same images as first time and on my server i replaced this images with other one ( with same name and extension ). I need your help
here is my fragment code:
package layout;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import com.example.pecurka.clubdraganm.R;
import com.loopj.android.image.SmartImageView;
public class second_frag extends Fragment {
private ProgressBar progress;
private String url;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.second_frag, container, false);
url = getArguments().getString("msg");
SmartImageView myImage2 = (SmartImageView) v.findViewById(R.id.my_image2);
myImage2.setImageResource(R.drawable.logo);
myImage2.setImageUrl(url);
FrameLayout r_frag2 = (FrameLayout) v.findViewById(R.id.reservieren_frag2);
r_frag2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager pager = (ViewPager) getActivity().findViewById(R.id.viewPager);
pager.setVisibility(View.GONE);
LinearLayout indicator = (LinearLayout) getActivity().findViewById(R.id.indicator);
indicator.setVisibility(View.GONE);
progress = (ProgressBar) getActivity().findViewById(R.id.progressBar1);
progress.setVisibility(View.VISIBLE);
WebView web = (WebView) getActivity().findViewById(R.id.webView);
web.loadUrl("http://plastifikacija-bogdanic.com/dm/reservierung");
web.setWebViewClient(new MyWebViewClient());
WebSettings webSettings = web.getSettings();
webSettings.setJavaScriptEnabled(true);
getActivity().setTitle("Reservierung");
}
});
return v;
}
public static second_frag newInstance(String text) {
second_frag f = new second_frag();
Bundle b = new Bundle();
b.putString("msg", text);
f.setArguments(b);
return f;
}
private class MyWebViewClient extends WebViewClient {
@Override
public void onPageFinished(WebView view, String url) {
progress.setProgress(100);
progress.setVisibility(View.GONE);
WebView web = (WebView) getActivity().findViewById(R.id.webView);
web.setVisibility(View.VISIBLE);
FrameLayout reservieren = (FrameLayout) getActivity().findViewById(R.id.submitbtn);
reservieren.setVisibility(View.VISIBLE);
super.onPageFinished(view, url);
}
}
}
I have three fragments the same as this one and this fragments are showing in viewpager, and i will whn i replace images on server that the images load automaticali at next startup in my app.
Thanks