I have a home screen with a Home button. This screen is the default screen when my application starts up. I would like to show the Home button as selected to indicate that the user is in the Home screen when my app starts. How do I do that? Please help.
Thanks.
I think for what you want to do you want to either use a group of RadioButtons, or tabs. If you just want a button that looks different in different states, try using a StateSelector.
Related
I have multiple screens in my app in which each screen has next and previous buttons except the first screen. when I click the previous button on 3rd screen it needs to go back to the 2nd screen and when I click next button on 3rd screen it needs to go to the 4th screen. In addition to it, the data of the screens need to be saved i.e. when I clicked the previous button on 3rd screen then the 2nd screen with already filled should be displayed. Similar with the next button also. Can anyone help me to implement this?
Thank you.
I'm working on a lockscreen widget(not trying to be specific here, but Nexus 7 ) . The widget has a button which would trigger an activity.When the user clicks the button, the unlock slide symbol get's highlighted hinting the user has to slide-unlock his screen before he wants to see the button's activity. Since now, the device is locked,is there a way to bypass this and just display the activity on top of the lock screen? (not in the case of pin/pattern obviously, but only just slide)
Was searching a lot for a way to do it. We need to use flags in while giving an intent to the widget button. More information here.
Android Lock Screen Widget
I have an activity which acts like a home screen. My question is how can I programmatically ask the user which home screen wants to be the default? I don't want to set my home screen as the default, but to show to the user the dialog to choose the home screen he wants.
My answer is how can I programmatically ask the user which home screen wants to be the default?
The only way to do that is to trigger the home screen to appear, by starting an ACTION_MAIN/CATEGORY_HOME activity. If there is a choice to be made, between your home screen, the device default home screen, and others, the user will get a chooser and will be able to choose which home screen to display. They will also get the "make this the default for this action" checkbox. However, this also has the effect of taking the user to their chosen home screen, and they do not have to set a default.
My recommendation would be for you to leave this alone. They will see this chooser the next time they press the HOME button, anyway, and they will then expect to go to their chosen home screen.
I have a menu that I want to appear on the screen when the app starts, without the user having to press the menu key.
What is a good way to achieve that?
Maybe Activity.openOptionsMenu() or Activity.openContextMenu?
I want to add a button on the home screen and want to code in the click event of that button.
I have an application which has an activate button,As soon as this activate button is clicked i want that a Button gets created on the home screen and i want to code some database queries in its click event.I have already created that application,Now i want to place the button on the home screen.How do i do that.
Thanks in Anticipation.
I don't think you can create a button on the Home Screen on-the-fly by coding. In my book, the only way to get a button on the Home Screen is if the user adds it as a widget.
If you are using xml layout for it add the button widget you needed and set it's visibility by android:visibility="gone",when you clicked the first button to activate the button to display,make it to visible by getting the id of the corresponding button
for eg: btn2.setVisibility(View.VISIBLE);