-1
當按鈕點擊鏈接時如何在android中隱藏網頁不可用頁面?請任何可以發送代碼。如何在android中點擊按鈕時隱藏web不可用頁面?
我的代碼
package com.example.mysd;
import android.content.Intent;
import android.view.View.OnClickListener;
import android.widget.Button;
public class mysd extends Activity {
Button button1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mysd);
addListenerOnButton1();
}
public void addListenerOnButton1() {
button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent browserIntent =
new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.google.com/"));
startActivity(browserIntent);
}
});
}
}