[英]How to load activty while Splash Screen
我有一個viewpager,其中包含7張幻燈片。 但是幻燈片的內容是HTML,所以我想在啟動畫面中加載HTML的數據,然后再顯示內容。 我的內容在我的活動的InstantiateItem方法中膨脹。
@Override
public Object instantiateItem(ViewGroup container, int position) {
layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
HTMLPre preparer = new HTMLPre();
String font = "SourceSansPro-Regular";
View one = layoutInflater.inflate(R.layout.slide_type_a, container, false);
WebView header_1_a = (WebView) one.findViewById(R.id.header_slide_type_a_1);
preparer.loadHTLMContentHeader(getString(R.string.Aktien1_header),header_1_a,font);
ImageView image_1_a = (ImageView) one.findViewById(R.id.image_slide_type_a_1);
image_1_a.setImageResource(R.drawable.picture_kap01_01);
WebView text_1_a = (WebView) one.findViewById(R.id.text_slide_type_a_1);
preparer.loadHTLMContentText(getString(R.string.Aktien1), text_1_a,font);
View two = layoutInflater.inflate(R.layout.slide_type_a, container, false);
header_1_a = (WebView) two.findViewById(R.id.header_slide_type_a_1);
preparer.loadHTLMContentHeader(getString(R.string.Aktien2_header),header_1_a,font);
image_1_a = (ImageView) two.findViewById(R.id.image_slide_type_a_1);
image_1_a.setImageResource(R.drawable.picture_kap01_01);
text_1_a = (WebView) two.findViewById(R.id.text_slide_type_a_1);
preparer.loadHTLMContentText(getString(R.string.Aktien2), text_1_a,font);
View three = layoutInflater.inflate(R.layout.slide_type_a, container, false);
header_1_a = (WebView) three.findViewById(R.id.header_slide_type_a_1);
preparer.loadHTLMContentHeader(getString(R.string.Aktien3_header), header_1_a,font);
image_1_a = (ImageView) three.findViewById(R.id.image_slide_type_a_1);
image_1_a.setImageResource(R.drawable.boerse_antwerpen);
text_1_a = (WebView) three.findViewById(R.id.text_slide_type_a_1);
preparer.loadHTLMContentText(getString(R.string.Aktien3), text_1_a,font);
View four = layoutInflater.inflate(R.layout.slide_type_a, container, false);
header_1_a = (WebView) four.findViewById(R.id.header_slide_type_a_1);
preparer.loadHTLMContentHeader(getString(R.string.Aktien4_header), header_1_a,font);
image_1_a = (ImageView) four.findViewById(R.id.image_slide_type_a_1);
image_1_a.setImageResource(R.drawable.parketthandel);
text_1_a = (WebView) four.findViewById(R.id.text_slide_type_a_1);
preparer.loadHTLMContentText(getString(R.string.Aktien4), text_1_a,font);
View five = layoutInflater.inflate(R.layout.slide_type_c, container, false);
image_1_a = (ImageView) five.findViewById(R.id.image_slide_type_c_1);
image_1_a.setImageResource(R.drawable.parketthandel);
text_1_a = (WebView) five.findViewById(R.id.text_slide_type_c_1);
preparer.loadHTLMContentText(getString(R.string.Aktien5), text_1_a,font);
View six = layoutInflater.inflate(R.layout.slide_type_c, container, false);
image_1_a = (ImageView) six.findViewById(R.id.image_slide_type_c_1);
image_1_a.setImageResource(R.drawable.parketthandel);
text_1_a = (WebView) six.findViewById(R.id.text_slide_type_c_1);
preparer.loadHTLMContentText(getString(R.string.Aktien6), text_1_a,font);
View seven = layoutInflater.inflate(R.layout.slide_type_c, container, false);
image_1_a = (ImageView) seven.findViewById(R.id.image_slide_type_c_1);
image_1_a.setImageResource(R.drawable.parketthandel);
text_1_a = (WebView) seven.findViewById(R.id.text_slide_type_c_1);
preparer.loadHTLMContentText(getString(R.string.Aktien7), text_1_a,font);
View eigth = layoutInflater.inflate(R.layout.slide_type_c, container, false);
image_1_a = (ImageView) eigth.findViewById(R.id.image_slide_type_c_1);
image_1_a.setImageResource(R.drawable.seewegevoc);
text_1_a = (WebView) eigth.findViewById(R.id.text_slide_type_c_1);
preparer.loadHTLMContentText(getString(R.string.Aktien8), text_1_a,font);
View nine = layoutInflater.inflate(R.layout.startquiz_layout, container, false);
View viewarr[] = {one, two, three, four, five, six, seven, eigth, nine};
container.addView(viewarr[position]);
return viewarr[position];
}
所以現在我想加載在啟動屏幕加載時在此活動中完成的操作。 有人有想法嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.