我设置webviewClient来打开其中的所有Instagram链接,除了按钮提供的链接"在应用程序中打开"
PROCEDURE [dbo].[Insert_UserInformation]
(@FullName varchar(300),
@FatherName varchar(300),
@DOB varchar(50),
@PlaceofBirth varchar(200),
@EmailId varchar(300),
@Address varchar(300),
@State varchar(150),
@Password varchar(50),
@Role varchar(50),
@Status INT output
AS
BEGIN
BEGIN TRY
DECLARE EmailId1 VARCHAR(50)
DECLARE EmailId2 VARCHAR(50)
SELECT EmailId1 = EmailId
FROM Table_Registraiton
WHERE EmailId = @EmailId
SELECT EmailId2 = EmailId
FROM Table_login
WHERE EmailId = @EmailId
set @Status=0
IF(EmailId1 IS NOT NULL AND EmailId2 IS NOT NULL
BEGIN
SET @Status =1 -- 'Duplicate'
END
else
begin
begin transaction
if(EmailId1 IS NULL)
BEGIN
INSERT INTO Table_Registration(FullName, FatherName, DOB, PlaceofBirth,
EmailId, Address, State)
VALUES (@FullName, @FatherName, @DOB, @PlaceofBirth,
@EmailId, @Address, @State)
SET @Status =2 -- REGISTRATION 'Success'
END
if(EmailId2 IS NULL and @Status=2)
BEGIN
INSERT INTO Table_login (Name, EmailId, Password, Role)
VALUES (@FullName, @EmailId, @Password, @Role)
SET @Status =@Status+3-- 'Success'
END
commit
end
END TRY
BEGIN CATCH
if(@@TRANCOUNT>0)
rollback
RAISERROR('Insert Failed',16,1)
END CATCH
END
然而,当我点击链接后面的那个按钮没有打开Android应用程序时,谷歌播放
webView.setWebViewClient(new WebViewClient() {
@Override public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.e("mcheck", "" + url);
if (!url.contains("com.instagram.android")) {
view.loadUrl(url);
return false;
} else {
Log.e("mcheck", "want to open outside" + url);
return true;
}
}
});
为什么会这样?