I have a problem with application development, I create a widget that can be either on the lockscreen or on the home page. when in lockscreen I want that when the user clicks a button, a widget prompt to enter the user if necessary. I mean a hint for checking a password or recognizing faces depending on whether any of these security settings are enabled. after the user enters his template, the widget will launch the application (intention).
I noticed that some widgets request login and others, I did not find the difference between them.
I think it should be on the onReceive method, but not sure how I can call this "login" method, while on onReceive I start the intent
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.getApplicationContext().startActivity(i);
but it still doesn’t request a login. when the widget is on a locked screen.
let's say that the user interacts with widgets on the lock screen, the user is not prompted to enter a password, since the user enters his template | password and after the user "enter" his home screen and the application starts. Thus, the widget will really trigger the intent, just do not let the user “know” or log in to see the application.
Any thoughts on how I can suggest the user to enter their template so that it goes to the main screen?
[change]
The problem occurs when I try to run an intent in BroadcastReceiver. What I'm doing allows the user to interact with widgetd buttons, depending on what the user has selected. I will open the application, adding some additions to the intention.
so in the onReceive method of my BroadcastReceiver I'm trying to run:
Intent i = new Intent(context, MyActivity.class); i.putExtra(WidgetUtils.TAG_CURRENT_SELECTION, StringIGotFromInteraction); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.getApplicationContext().startActivity(i);
thus, the intention does not request an “unlock”.
If in onUpdate I drop the pending intent on any button when the user clicks this button, it asks for an unlock as follows:
views.setOnClickPendingIntent(R.id.aButton, buildAPendingIntent(context));
but I need to know what the user has chosen to open, and the intention if opened.
and my contex.startActivity Approach method works fine when the widget is on the main screen, and not on the backlit screen.
Any thoughts on how I can do this.