0
沒有其他方式詢問此問題。我正在使用android工作室,我已經設置了一個可滾動的滑動選項卡的應用程序,我設置了4個選項卡,我希望在選項卡2中有一個網頁加載,我有一個webview類和一個Internet類,我已設置清單以允許Internet ,但我沒有在我的佈局文件上的按鈕,並設置onlcik listner加載我的webpge,我想知道的是我如何加載webview時,我刷卡到第2頁,而不使用按鈕希望在沒有按鈕的情況下在幻燈片2中打開webview
代碼如下
public DummySectionFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if ((getArguments().getInt(ARG_SECTION_NUMBER)==1)) {
View view = inflater.inflate(R.layout.phones, container, false);
return view;
}
if ((getArguments().getInt(ARG_SECTION_NUMBER)==2)) {
View view = inflater.inflate(R.layout.webload, container, false);
Button webButton = (Button)view.findViewById(R.id.view7);
webButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(getActivity(), Internet.class);
startActivity(intent);
}
});
return view;
}
所有的
`
任何信息都將是巨大的,請傢伙..三江源 – jamie