Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Chrome not firing after lockscreen app

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? :)

like image 699
Ankish Jain Avatar asked Sep 16 '13 19:09

Ankish Jain


1 Answers

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 :)

like image 80
Michele La Ferla Avatar answered Oct 25 '22 18:10

Michele La Ferla