Android Google Chrome not firing after lockscreen app
Asked Answered
T

2

13

I have a lockscreen app, my activity is the first when the user hits unlock power button. I have a website link on the lockscreen-app. When the pattern-unlock is disabled , chrome gets fired with the the website link. But when I enable the security pattern, after the user enters his pattern, chrome app opens but the website is not fired.

pattern-lock enabled

MYLOCK-SCREENAPP > CLICK THE LINK > goes to default lockscreen, user enters pattern > Chrome launches but not the website.

pattern-lock disable

MYLOCK-SCREENAPP > CLICK THE LINK > Chrome launches but not the website.

I am using below, to launch the website.

url="http://(any url)"
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Would be glad to get this solved. any experts? :)

Tricorn answered 16/9, 2013 at 19:27 Comment(7)
Can you post some more code? I may be able to help if you show how the code is implemented. I am assuming there is something happening between the unlock. Is the website opening when the pattern-lock is disabled?Ment
1. If security lock is NOT enabled, it works fine with both Chrome and Opera 2. If security lock IS enabled, clicking on the link of lockscreen app first shows the security keypad and once I unlock there a. And if only Chrome is installed, it does not work. In the logcat, Chrome app does log that it received the VIEW intent, with the right url in the intent data, but nothing after. Chrome just opens an empty tab b. And if both Chrome and Opera are installed, it works fine on eitherGanger
Exactly.. i have seen apps which fires correct URL in chrome too. Just puzzeled with that.Tricorn
did you try using a webview with WebChromeClient ?Mcbrayer
Webview is not the solution.Chrome should be fired after the lockscreen.Tricorn
I did try with, Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.com")); startActivity(browserIntent); And I have AppLock application, applied on Chrome, Opera and UCBrowser and seems work fine on all of three.Newmint
@Ramyle I have have the same issue just as described. Android Chrome does not load the url behind the lock screen. Were you able to get around this? Any luck AnkishJain?Odontology
J
4

I would open the web page as follows:

public void OpenUrl() {         

    private WebView View;
    View = (WebView) WebDialog.findViewById(R.id.ticketline);  
    View.setWebViewClient(new WebConn());
    View.setScrollbarFadingEnabled(true);  
    View.setHorizontalScrollBarEnabled(false);  
    View.getSettings().setJavaScriptEnabled(true);
    View.loadUrl("url to be loaded goes here");

    getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit();
    WebDialog.show();
}

Alternatively you could try the following:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("url goes here")); 
startActivity(browserIntent);
finish();

Hope this helps :)

Jett answered 26/9, 2014 at 9:54 Comment(6)
I had tried this earlier. Webview does not render all things of a website correctly. Not a solution to the above problem but a good try.Tricorn
Yes. Problem is , the chrome to fire after the lockscreen.Tricorn
Hi @AnkishJain I amended the answer to give you an alternative solution which could work.Jett
Hi @AnkishJain could you please accept the answer if it has helped you?Jett
I need to test out. I am working on a solution too. hold on :). I dont think FLAG_DISMISS_KEYGUARD is a good idea.Andoroid security Lockscreen would pop up at later stage , i had tried that .Tricorn
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("url goes here")); startActivity(browserIntent); finish(); In this lockscreen will appear again in between when you have a security lock. If there is security , first that should be prompted after that Chrome must load once unlocked. App are doing this , its possible.Tricorn
P
0

I have got the same problem, I believe this is a bug in Chrome as other browsers, like Firefox and Opera, they work properly. But I found a workaround

Android lock screen notification is not able to open Browser on double tapping

Let me know whether this works for you or not.

Proprioceptor answered 13/9, 2016 at 0:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.