当我使用自定义方案(例如myhttp)时,一切正常,但是如果我使用http,它不会处理,并且每次浏览器打开主机时(例如:192.168。 1.111)。在Android中处理http协议的自定义url
我怎样才能解决这个问题?
我的manifest.xml
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:host="192.168.1.111"/>
</intent-filter>
我的活动:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = getIntent();
Log.i("MyTAG", "here--01");
}
感谢答复,但不幸的是它具有相同的结果。我试过了,Chrome和Firefox。 – chrome 2013-05-04 10:34:33
@chrome更新了我的答案 – Blundell 2013-05-04 11:37:39
我查看了设置,但没有默认设置,因此它的按钮被禁用。您的评论后,当我长时间按我的自定义网址。其次,浏览器建议我使用MyApp打开。 – chrome 2013-05-04 11:46:56