小菜菜学习笔记~
先说说这个隐式intent调用浏览器老是闪退的问题:
照着书上学的时候,确保action和category都没有问题,但是运行总是闪退,在寻找原因的过程中看到别人的代码中intent的参数是空,想着会不会是这个原因,于是把参数删掉,运行成功。。。。
BUT!当我再加入参数的时候,却还是运行成功了?所以刚刚发生了什么??
action和intent参数各种搭配如下(有点小无聊,小菜菜的任性~):
一、action字符串为"android.intent.action.VIEW",intent有参数Intent.ACTION_VIEW:
<activity android:name=".SecondActivity">
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"/>
</intent-filter>
</activity>
Button button1 = (Button) findViewById(R.id.btt1)