Android Button Visiblity [duplicate] - java

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Problem with Image Button visibility! Android
When you start the application, the buttons should be visible for 5 seconds and then become invisible, so people will know there are buttons on the screen. For example If I have a MapActivity running, the button will be an obstruction. So I want to make it invisible. It should be visible again on touching that area or around that button area so as to trigger another activity. I tried setting visibilitiy. nextbutton.setVisibility(View.INVISIBLE) I can't make it visible onTouch() Please help me with the problem.

See your original thread which has more than enough information for you to do what you want.

Related

Entering background mode [duplicate]

This question already has answers here:
Android - Simulate Home click
(4 answers)
Closed 1 year ago.
How to programmatically, e.g. using a button, make the app switch to background mode. Actually, I mean the action that the "home screen button" does, but I want to programmatically do it on my button. Thanks.
finish();
System.exit(0);
Cause exited from app.
you can use below backstack function to move the app to background mode:
moveTaskToBack(true)

Hide permanent system Bar Android [duplicate]

This question already has answers here:
full screen application android
(8 answers)
Closed 5 years ago.
What is the best way to hide permanent system bar on android?
I want a full-screen app without system bar.
All that I got so far is hide the bar, but if I swipe up it appears.
Any suggestion?
try this
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

Android: Black Screen appears on the screen when search operation is performed by android SearchView [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am making a music player application on android. My Launcher Activity(MainActivity.java) displays all the songs in a Custom ListView. My app was running perfectly and then I decided to add a SearchView widget in the ToolBar.
Now when I type a query in the SearchView, me Searchable.java activity opens up and after 2-3 sconds the whole screen turns black. The search results are shown for a brief time but the black screen stays there permanently.
If don't use the search option then the application shows no such behavior.
Your app displaying black screen because you are doing search operations on your main thread , that's why your main thread hanging , check your log monitor you will get error like , too much work on main thread , for overcome this issue you need to perform your search operations on another thread or in background and update your view when search completed , you can use Asynctask for background task .

How to use android button png as a button in my app [duplicate]

This question already has answers here:
How to set image button backgroundimage for different state?
(9 answers)
Closed 7 years ago.
I have a two png files. The button and it's "pressed state".
1)How do I replace the default android button with my png(the text of the button is included in the png, there's no need to define a textView over the image.
2) And also how do I implement the "onPress" state png???.
I've been 3 days searching for answers but there's little to no information on this subject in particular. I just found the rotate animations an all of that, but nothing on how to replace a default button with a drawable and then use another png file when the user press the button
If you want to use an image in your Button you just have to put it on the drawable folder and then in the background of your Button you can do:
android:background="#drawable/image"

How to put camera sensor inside my Activity? [duplicate]

This question already has an answer here:
Custom camera android
(1 answer)
Closed 8 years ago.
There is an application made by another developer and I need to continue it. It has an activity with a button that calls the default camera app as an intent with startActivityForResult. It works ok when they take only one picture per app session. But now the client wants to be able to take various photos from different position of the place and then upload them all to the web server. So I need another way to do that, faster than opening the camera app for every picture.
For this I wish to load the camera directly in my activity, place a 'shoot' button, a label with the number of pictures taken, an imageView with the last image saved, and a button to finish. As an example I show you this printed screen from Internet.
The idea is to save a picture on every button click, and save the file names in an array.
How can I use the camera this way and control it with a custom button?
I also try to control the camera and I am using this link
I hope it is useful for you. It has helped me to fix several bugs

Categories