一个简单的网页浏览器

自己写的,实现简单的网页浏览,就是不能实现观看视频全屏还不能下载,有History.

标签: Android Applications Manager

[1].[文件] History.java ~ 5KB    下载(42) 跳至 [1] [2] [3] [4] [5]

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

package

com.rong05.webview;

import

java.io.FileInputStream;

import

java.io.FileNotFoundException;

import

java.io.FileOutputStream;

import

java.io.IOException;

import

java.util.ArrayList;

import

java.util.HashMap;

import

java.util.List;

import

java.util.Map;

import

android.app.Activity;

import

android.os.Bundle;

import

android.view.View;

import

android.view.View.OnClickListener;

import

android.widget.AdapterView;

import

android.widget.AdapterView.OnItemClickListener;

import

android.widget.Button;

import

android.widget.ListView;

import

android.widget.SimpleAdapter;

public

class

History
extends

Activity {

    ListView
list;

    Button
back,clear;

    private

List<Map<String,String>> historyList =
new

ArrayList<Map<String,String>>();

    SimpleAdapter
adapter;

    String
wordsTitle[];

    String
wordsHistory[];

    @Override

    protected

void

onCreate(Bundle savedInstanceState) {

        //
TODO Auto-generated method stub

        super.onCreate(savedInstanceState);

        super.setContentView(R.layout.history);

        list=(ListView)
findViewById(R.id.historylist);

        back=(Button)
findViewById(R.id.back);

        clear=(Button)
findViewById(R.id.clear);

        getHistory();

        getTitles();

        for(int

i=
0;i<wordsHistory.length&&i<wordsTitle.length;i++){

            Map<String,String>
map=
new

HashMap<String, String>();

            map.put("title",wordsTitle[i]);

            map.put("history",wordsHistory[i]);

            historyList.add(map);

        }

        adapter=new

SimpleAdapter(getApplicationContext(),historyList,R.layout.data_list,
new

String[]{
"title","history"},new

int
[]{R.id.textView1,R.id.textView2});

        list.setAdapter(adapter);

        list.setOnItemClickListener(listlistener);

        back.setOnClickListener(backListener);

        clear.setOnClickListener(clearListener);

    }

    //读取history.txt中的历史信息

    void

getHistory(){

        FileInputStream
fis=
null;

        try

{

            fis=openFileInput("history.txt");  

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        try

{

            byte[]
bate=
new

byte
[fis.available()];

            while(fis.read(bate)!=-1){

            }

            String
str=
new

String(bate);

            wordsHistory=str.split(";");

        }
catch

(IOException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

    }

    //读取title.txt中的网页标题

    void

getTitles(){

        FileInputStream
fis=
null;

        try

{

            fis=openFileInput("title.txt");

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        try

{

            byte[]
bate=
new

byte
[fis.available()];

            while(fis.read(bate)!=-1){

            }

            String
str=
new

String(bate);

            wordsTitle=str.split(";");

        }
catch

(IOException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

    }

    //实现ListView的事件

    OnItemClickListener
listlistener=
new

OnItemClickListener() {

        @Override

        public

void

onItemClick(AdapterView<?> arg0, View arg1,
int

arg2,

                long

arg3) {

            //
TODO Auto-generated method stub

            //将信息返回到mainActivity中

            History.this.getIntent().putExtra("retmsg",historyList.get(arg2).get("history"));

            History.this.setResult(RESULT_OK,History.this.getIntent());

            History.this.finish();

        }

    };

    //对返回按键的监听

    OnClickListener
backListener=
new

OnClickListener() {

        

        @Override

        public

void

onClick(View v) {

            //
TODO Auto-generated method stub

            History.this.setResult(RESULT_CANCELED,
getIntent());

            //停止当前页面

            History.this.finish();

        }

    };

    //对清除历史记录按键的监听

    OnClickListener
clearListener=
new

OnClickListener() {

        @Override

        public

void

onClick(View v) {

            //
TODO Auto-generated method stub

            deleteHistory();

            deleteTitle();

            //让ListView清空

            list.removeAllViewsInLayout();

        }

    };

    //删除history.txt的内容

    void

deleteHistory(){

        FileOutputStream
fos=
null;

        try

{

            fos=openFileOutput("history.txt",MODE_PRIVATE);

            try

{

                fos.write("".getBytes());

            }
catch

(IOException e) {

                //
TODO Auto-generated catch block

                e.printStackTrace();

            }

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        try

{

            fos.flush();

            fos.close();

        }
catch

(IOException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

    }

    //删除title.txt的内容

    void

deleteTitle(){

        FileOutputStream
fos=
null;

        try

{

            fos=openFileOutput("title.txt",MODE_PRIVATE);

            try

{

                fos.write("".getBytes());

            }
catch

(IOException e) {

                //
TODO Auto-generated catch block

                e.printStackTrace();

            }

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        try

{

            fos.flush();

            fos.close();

        }
catch

(IOException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

    }

}

[2].[文件] WebMainActivity.java ~ 8KB    下载(23) 跳至 [1] [2] [3] [4] [5]

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

package

com.rong05.webview;

import

java.io.FileNotFoundException;

import

java.io.FileOutputStream;

import

java.io.IOException;

import

android.annotation.SuppressLint;

import

android.app.Activity;

import

android.content.Intent;

import

android.graphics.Bitmap;

import

android.os.Bundle;

import

android.util.FloatMath;

import

android.view.KeyEvent;

import

android.view.Menu;

import

android.view.MotionEvent;

import

android.view.View;

import

android.view.View.OnClickListener;

import

android.webkit.ValueCallback;

import

android.webkit.WebChromeClient;

import

android.webkit.WebSettings;

import

android.webkit.WebView;

import

android.webkit.WebViewClient;

import

android.widget.Button;

import

android.widget.EditText;

import

android.widget.FrameLayout;

import

android.widget.ProgressBar;

public

class

WebMainActivity
extends

Activity {

    Button
go,next,last,history;

    EditText
input;

    WebView
web;

    ProgressBar
progress;

    static

double

beforeLenght=
0,changeLenght=0;

    static

String FILE_NAME=
"history.txt";

    @SuppressLint("SetJavaScriptEnabled")

    @Override

    protected

void

onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_web_main);

        findView();

        web.loadUrl("http://baidu.com");

        web.setWebViewClient(client);

        WebSettings
setter=web.getSettings();

        //实现JavaScrip

        setter.setJavaScriptEnabled(true);

        //实现网页的缩放

        setter.setBuiltInZoomControls(true);

        setter.setJavaScriptCanOpenWindowsAutomatically(true);

        setter.setGeolocationEnabled(true);

        web.setWebChromeClient(chromeClient);

        go.setOnClickListener(new

Action());

        next.setOnClickListener(new

Action());

        last.setOnClickListener(new

Action());

        history.setOnClickListener(new

Action());

        if(WebMainActivity.changeLenght>WebMainActivity.beforeLenght)

            web.zoomIn();

        else

            if(WebMainActivity.changeLenght<WebMainActivity.beforeLenght)

                web.zoomOut();

    }

    /**

     *
对WebView的实现其中的方法

     *
*/

     WebViewClient
client=
new

WebViewClient(){

         //该方法是让网页在WebView中显示不调用本地浏览器

            @Override

            public

boolean

shouldOverrideUrlLoading(WebView view, String url) {

                //
TODO Auto-generated method stub

                return

super
.shouldOverrideUrlLoading(view,
url);

            }

        //对历史记录的刷新

        @Override

        public

void

doUpdateVisitedHistory(WebView view, String url,

                boolean

isReload) {

            //
TODO Auto-generated method stub

             last.setEnabled(web.canGoBack()); 

              next.setEnabled(web.canGoForward());

            super.doUpdateVisitedHistory(view,
url, isReload);

        }

        //在读完网页后对其进行的操作

        @Override

        public

void

onPageFinished(WebView view, String url) { 

            //设置程序的标题为网页的标题 

                    if

(web.getTitle() !=
null)

                        WebMainActivity.this.setTitle(web.getTitle()); 

                        getTitles(web.getTitle());

                        getHistory(url);

                    }

                }

        //在开始读取网页时对其进行的操作

        @Override

        public

void

onPageStarted(WebView view, String url, Bitmap favicon) {

            //
TODO Auto-generated method stub

            WebMainActivity.this.setTitle("Loading..."); 

            last.setEnabled(web.canGoBack()); 

            next.setEnabled(web.canGoForward()); 

            super.onPageStarted(view,
url, favicon);

        }     

    };

    /**

     *
对WebView的实现其中 WebChromeClient的方法

     */

    WebChromeClient
chromeClient=
new

WebChromeClient(){

        //实现进度条

        @Override

        public

void

onProgressChanged(WebView view,
int

newProgress) {

            //
TODO Auto-generated method stub

            super.onProgressChanged(view,
newProgress);

            progress.setProgress(newProgress);

        }

        //对历史记录的刷新

        @Override

        public

void

getVisitedHistory(ValueCallback<String[]> callback) {

            //
TODO Auto-generated method stub

            super.getVisitedHistory(callback);

        }

    };

    //实现Button的按钮的动作

    public

class

Action
implements

OnClickListener{

        @Override

        public

void

onClick(View v) {

            //
TODO Auto-generated method stub

            switch(v.getId()){

            case

R.id.go:

                WebMainActivity.this.web.loadUrl(WebMainActivity.this.input.getText().toString().trim());

                WebMainActivity.this.input.setText("http://");

                break;

            case

R.id.last:

                if(WebMainActivity.this.web.canGoBack())

                    WebMainActivity.this.web.goBack();

                else

                    v.setClickable(false);

                break;

            case

R.id.next:

                if(WebMainActivity.this.web.canGoForward())

                    WebMainActivity.this.web.goForward();

                else

                    v.setClickable(false);

                break;

            case

R.id.history:

                //跳转到History页面

                Intent
intent=
new

Intent(getApplicationContext(),History.
class);

                WebMainActivity.this.startActivityForResult(intent,
1);

                break;

            default:

                break;

            }

        }

    }

    /**

     *
实现触摸事件

     */

    @Override

    public

boolean

onTouchEvent(MotionEvent event) {

        //
TODO Auto-generated method stub

        if(event.getHistorySize()==2)

            switch(event.getAction())

            {

                case

MotionEvent.ACTION_DOWN:

                    WebMainActivity.beforeLenght=Spacing(event);

                case

MotionEvent.ACTION_UP:

                    WebMainActivity.changeLenght=Spacing(event);

                default:

                    break;

                

            }

        return

super
.onTouchEvent(event);

    }

    /**

     *
计算两指的距离

     *
@param event

     *
@return

     */

    private

float

Spacing(MotionEvent event) {

          float

x = event.getX(
0)
- event.getX(
1);

          float

y = event.getY(
0)
- event.getY(
1);

          return

FloatMath.sqrt(x * x + y * y);

    }

    //findViewById实现布局中的控件

    public

void

findView(){

        go=(Button)findViewById(R.id.go);

        next=(Button)findViewById(R.id.next);

        last=(Button)findViewById(R.id.last);

        history=(Button)findViewById(R.id.history);

        input=(EditText)findViewById(R.id.inputText);

        web=(WebView)findViewById(R.id.web);

        progress=(ProgressBar)findViewById(R.id.progress);

    }

    //得到历史信息写入history.txt

    public

void

getHistory(String  url){

        FileOutputStream
fos =
null;

        try

{

            fos=openFileOutput(FILE_NAME,
MODE_APPEND);

            try

{

                fos.write((url+";").getBytes());

            }
catch

(IOException e) {

                //
TODO Auto-generated catch block

                e.printStackTrace();

            }

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        finally{

            if(fos!=null){

                try

{

                    fos.flush();

                    fos.close();

                }
catch

(IOException e) {

                    //
TODO Auto-generated catch block

                    e.printStackTrace();

                }

            }

        }

    }

    //得到网页的标题写入title.txt

    public

void

getTitles(String  url){

        FileOutputStream
fos =
null;

        try

{

            fos=openFileOutput("title.txt",
MODE_APPEND);

            try

{

                fos.write((url+";").getBytes());

            }
catch

(IOException e) {

                //
TODO Auto-generated catch block

                e.printStackTrace();

            }

        }
catch

(FileNotFoundException e) {

            //
TODO Auto-generated catch block

            e.printStackTrace();

        }

        finally{

            if(fos!=null){

                try

{

                    fos.flush();

                    fos.close();

                }
catch

(IOException e) {

                    //
TODO Auto-generated catch block

                    e.printStackTrace();

                }

            }

        }

    }

    /**

     *
对History的Activity的返回信息进行操作

     */

    @Override

    protected

void

onActivityResult(
int

requestCode,
int

resultCode, Intent data) {

        //
TODO Auto-generated method stub

        switch(resultCode){

        case

RESULT_OK:

            web.loadUrl(data.getStringExtra("retmsg"));

            break;

        case

RESULT_CANCELED:

            break;

        default:

            break;

        }

    }

    //对返回键的重写

    @Override

    public

boolean

onKeyDown(
int

keyCode, KeyEvent event) {

        //
TODO Auto-generated method stub

        if(keyCode==KeyEvent.KEYCODE_BACK){

            if(web.canGoBack()){

                web.goBack();

                return

true
;

            }

            else{

                System.exit(0);

            }

            

        }

        return

super
.onKeyDown(keyCode,
event);

    }

    @Override

    protected

void

onPause() {

        //
TODO Auto-generated method stub

        web.pauseTimers();

        if(isFinishing()){

            web.loadUrl("about:blank");

            setContentView(new

FrameLayout(
this));

        }

        super.onPause();

    }

    @Override

    protected

void

onResume() {

        //
TODO Auto-generated method stub

        super.onResume();

        web.resumeTimers();

    }

    @Override

    public

boolean

onCreateOptionsMenu(Menu menu) {

        //
Inflate the menu; this adds items to the action bar if it is present.

        getMenuInflater().inflate(R.menu.web_main,
menu);

        return

true
;

    }

}

[3].[文件] activity_web_main.xml ~ 2KB    下载(21) 跳至 [1] [2] [3] [4] [5]

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

<LinearLayout

xmlns:android
="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical"

    tools:ignore="WebViewLayout,TextFields,HardcodedText,InefficientWeight,ButtonStyle"

>

    <LinearLayout

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:orientation="horizontal"

        >

        <Button

            android:id="@+id/go"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/go"

/>

        <EditText

            android:id="@+id/inputText"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            android:text="http://"/>

    </LinearLayout>

    <ProgressBar

        android:id="@+id/progress"

        style="?android:attr/progressBarStyleHorizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

/>

    <FrameLayout

        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:layout_weight="1"

>

        <WebView

            android:id="@+id/web"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

/>

    </FrameLayout>

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:gravity="center"

        android:orientation="horizontal"

        >

        <Button

            android:id="@+id/last"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/last"

/>

        <Button

            android:id="@+id/next"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/next"

/>

        <Button

            android:id="@+id/history"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/history"

/>

    </LinearLayout>

</LinearLayout>

[4].[文件] data_list.xml ~ 681B    下载(23) 跳至 [1] [2] [3] [4] [5]

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

<?xml

version
="1.0"

encoding
="utf-8"?>

<LinearLayout

xmlns:android
="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical"

>

    <TextView

        android:id="@+id/textView1"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:textSize="15pt"

        android:text="TextView"

/>

    <TextView

        android:id="@+id/textView2"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:textSize="5pt"

        android:text="TextView"

/>

</LinearLayout>

[5].[文件] history.xml ~ 1KB    下载(25) 跳至 [1] [2] [3] [4] [5]

?


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

<?xml

version
="1.0"

encoding
="utf-8"?>

<LinearLayout

xmlns:android
="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical"

    tools:ignore="ButtonStyle,InefficientWeight"

>

    <FrameLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_weight="1"

>

        <ListView

            android:id="@+id/historylist"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            >

        </ListView>

    </FrameLayout>

    <LinearLayout

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:gravity="center"

        android:orientation="horizontal"

>

        <Button

            android:id="@+id/back"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/back"

/>

        <Button

            android:id="@+id/clear"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="@string/clear"

/>

    </LinearLayout>

</LinearLayout>

时间: 2024-12-29 11:48:18

一个简单的网页浏览器的相关文章

分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”

这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业不是百度来的,我只是百度了一些示例代码的意思,怎么用!算了,越解释万一越黑呢!哈哈O(∩_∩)O哈哈~) ----------------------------------------------------------------分界线------------------------------

python实现的一个简单的网页爬虫

学习了下python,看了一个简单的网页爬虫:http://www.cnblogs.com/fnng/p/3576154.html 自己实现了一个简单的网页爬虫,获取豆瓣的最新电影信息. 爬虫主要是获取页面,然后对页面进行解析,解析出自己所需要的信息进行进一步分析和挖掘. 首先需要学习python的正则表达式:http://www.cnblogs.com/fnng/archive/2013/05/20/3089816.html 解析的url:http://movie.douban.com/ 查看

jmeter压力测试的简单实例+badboy脚本录制(一个简单的网页用户登录测试的结果)

JMeter的安装:在网上下载,在下载后的zip解压后,在bin目录下找到JMeter.bat文件,双击就可以运行JMeter. http://jmeter.apache.org/ 在使用jmeter前要先下载jdk包,配置java环境.(参见Java环境配置教程) 配置完成后在运行窗口检查一下java -version确定java环境配置完成. 一.利用badboy进行自动脚本录制 下载BadboyInstaller-2.2.5.exe 并安装 下载地址:http://download.csd

javascript源码之js实现的一个简单的网页拾色器

今天学习了window对象,跟着学习了一个简单的网页拾色器的demo,拿出来和大家分享. 主页面代码: <!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>拾色器</title></head><body><h1>网页拾色器</h1>    <scr

Html+css 一个简单的网页模板

一个简单的网页模板,有导航.子菜单.banner部分 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3 <html> 4 <head> 5 <title>网页</title> 6 <meta charset="UTF-8&qu

登录一个简单的网页进行的操作

HTTP大致来讲就是一种协议 响应与请求一个普通网页大概分为几块 1.查找DNS (1)寻找浏览器自身缓存的DNS (2)寻找自身系统缓存的DNS (3)查找本地的HOST文件 (4)运营商本地缓存的DNS调用 2.根据DNS解析请求返回到系统与浏览器,得到IP地址 3.根据IP地址来一个三次握手(大致就是两者询问三次) 4.服务器请求回来 5.返回HTML解析CSS与HTML等等 6.返回一个完整的页面是

webView 显示一个简单的网页

public class MainActivity extends AppCompatActivity { private String url = "https://www.baidu.com"; private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layo

一个简单的网页益智游戏

<!doctype html> <html> <head> <meta charset="utf-8"> <title>益智游戏</title> <style type="text/css"> table{ width:500px; height:500px; border:1px solid red ; text-align:center ; border-collapse:col

一个简单的判断浏览器是否为IE9以下的方法

if(!-[1,]){ //是IE placeHolderIE9_(); }else{ //非IE if(navigator.userAgent.indexOf("MSIE 9.0")>0) { //ie9 placeHolderIE9_(); } } function placeHolderIE9_(){ //$("#css-rel").attr({href:"css/indexIT7-8.css"}); }