0
我想知道是否可以包含進度條,以便當用戶按下某個按鈕時 - 它加載頁面,但進度條在頁面顯示之前顯示加載。這是我的代碼。加載網頁時的進度條/ android
public class Sites extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sites);
View.OnClickListener openIt = new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(
Intent.ACTION_VIEW,
sites.this,
com.abc.example.Address.class
));
}
};
Button sites= (Button) findViewById(R.id.siteA);
sites.setTag(Uri.parse("http://sitea.com/"));
sites.setOnClickListener(openIt);
sites = (Button) findViewById(R.id.siteB);
sites.setTag(Uri.parse("http://siteb.com/"));
sites.setOnClickListener(openIt);
sites = (Button) findViewById(R.id.siteC);
sites.setTag(Uri.parse("https://sitec.com/"));
sites.setOnClickListener(openIt);
sites = (Button) findViewById(R.id.siteD);
sites.setTag(Uri.parse("https://sited.com/"));
sites.setOnClickListener(openIt);
}